netapi: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Mon, 10 Dec 2018 10:50:52 +0000 (11:50 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 10 Dec 2018 23:40:31 +0000 (00:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/netapi/sid.c

index 704964a79f4dc834bf28d6f3d4bbda74a7da0a2f..ba223749eff0ac198fab6e5727b1135d310545a7 100644 (file)
 int ConvertSidToStringSid(const struct domsid *sid,
                          char **sid_string)
 {
-       char *ret;
+       struct dom_sid_buf buf;
 
        if (!sid || !sid_string) {
                return false;
        }
 
-       ret = sid_string_talloc(NULL, (const struct dom_sid *)sid);
-       if (!ret) {
-               return false;
-       }
-
-       *sid_string = SMB_STRDUP(ret);
-
-       TALLOC_FREE(ret);
+       *sid_string = SMB_STRDUP(
+               dom_sid_str_buf((const struct dom_sid *)sid, &buf));
 
        if (!*sid_string) {
                return false;