diff options
author | Volker Lendecke <vl@samba.org> | 2013-12-03 16:01:35 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-01-09 20:41:15 +0100 |
commit | 044f8f71903084717271038d931d7dd47e8e74c3 (patch) | |
tree | 2f080266ed6342ef3a27c60439c90e7fe44bbdd7 | |
parent | 0c2fbe5a0c1a12751510840e285b7e45cc02ea22 (diff) | |
download | samba-044f8f71903084717271038d931d7dd47e8e74c3.tar.gz samba-044f8f71903084717271038d931d7dd47e8e74c3.tar.xz samba-044f8f71903084717271038d931d7dd47e8e74c3.zip |
group_mapping: Avoid a talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 9 20:41:15 CET 2014 on sn-devel-104
-rw-r--r-- | source3/groupdb/mapping_tdb.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 088874ff350..3cb1024829c 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -119,17 +119,15 @@ static bool init_group_mapping(void) static char *group_mapping_key(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) { - char *sidstr, *result; + char sidstr[DOM_SID_STR_BUFLEN]; + int len; - sidstr = sid_string_talloc(talloc_tos(), sid); - if (sidstr == NULL) { + len = dom_sid_string_buf(sid, sidstr, sizeof(sidstr)); + if (len >= sizeof(sidstr)) { return NULL; } - result = talloc_asprintf(mem_ctx, "%s%s", GROUP_PREFIX, sidstr); - - TALLOC_FREE(sidstr); - return result; + return talloc_asprintf(mem_ctx, "%s%s", GROUP_PREFIX, sidstr); } /**************************************************************************** |