summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2008-01-02 14:50:59 -0600
committerGerald (Jerry) Carter <jerry@samba.org>2008-01-02 14:50:59 -0600
commit701a56a698b580b21bfb0df73401ffe2d05f6f19 (patch)
tree891890cc1965e77e2d9f9fc456e282d614b713a5 /source3/lib
parent4656265a2337db1ef99769a6b30c0cf04fdd6cff (diff)
downloadsamba-701a56a698b580b21bfb0df73401ffe2d05f6f19.tar.gz
samba-701a56a698b580b21bfb0df73401ffe2d05f6f19.tar.bz2
samba-701a56a698b580b21bfb0df73401ffe2d05f6f19.zip
Make sure that wbcLookupSid() and wbcLookupRids() use talloc()'d memory.
Follows existing convention that all returned memory should be freed with wbcFreeMemory() and not directly with free(). Noticed by Volker. Txs. (This used to be commit 39c2059f66ee9eb471a503b9c776807b91c2a8f8)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/winbind_util.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/lib/winbind_util.c b/source3/lib/winbind_util.c
index f51a0171a2..2cabf5bcac 100644
--- a/source3/lib/winbind_util.c
+++ b/source3/lib/winbind_util.c
@@ -74,8 +74,8 @@ bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
DEBUG(10, ("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n",
sid_string_dbg(sid), domain_name, account_name));
- SAFE_FREE(domain_name);
- SAFE_FREE(account_name);
+ wbcFreeMemory(domain_name);
+ wbcFreeMemory(account_name);
if ((domain && !*domain) || (name && !*name)) {
DEBUG(0,("winbind_lookup_sid: talloc() failed!\n"));
@@ -192,8 +192,9 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
ret = wbcLookupRids(&dom_sid, num_rids, rids,
&dom_name, &namelist, &name_types);
- if (ret != WBC_ERR_SUCCESS)
+ if (ret != WBC_ERR_SUCCESS) {
return False;
+ }
*domain_name = talloc_strdup(mem_ctx, dom_name);
*names = TALLOC_ARRAY(mem_ctx, const char*, num_rids);
@@ -202,11 +203,11 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
for(i=0; i<num_rids; i++) {
(*names)[i] = talloc_strdup(names, namelist[i]);
(*types)[i] = (enum lsa_SidType)name_types[i];
-
- free(CONST_DISCARD(char*, namelist[i]));
}
- free(namelist);
- free(name_types);
+
+ wbcFreeMemory(CONST_DISCARD(char*, dom_name));
+ wbcFreeMemory(namelist);
+ wbcFreeMemory(name_types);
return True;
}