summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-06 11:40:35 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 15:00:02 +0100
commit62646b7666178bf03cd650056a61338e84b54b25 (patch)
tree33cb0f6131fac364b8aed6e7cd17659d3451e331 /source3/winbindd
parentd862bbd5dcffa3f1cb8e774724132a39b55dbd9f (diff)
downloadsamba-62646b7666178bf03cd650056a61338e84b54b25.tar.gz
samba-62646b7666178bf03cd650056a61338e84b54b25.tar.bz2
samba-62646b7666178bf03cd650056a61338e84b54b25.zip
winbind: Use talloc in resolve_username_to_alias().
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index ffed27b397..76970d6be4 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -1111,16 +1111,18 @@ NTSTATUS resolve_username_to_alias( TALLOC_CTX *mem_ctx,
if (!cache->tdb)
goto do_query;
- if ( (upper_name = SMB_STRDUP(name)) == NULL )
+ upper_name = talloc_strdup(mem_ctx, name);
+ if (upper_name == NULL) {
return NT_STATUS_NO_MEMORY;
+ }
if (!strupper_m(upper_name)) {
- SAFE_FREE(upper_name);
+ talloc_free(upper_name);
return NT_STATUS_INVALID_PARAMETER;
}
centry = wcache_fetch(cache, domain, "NSS/NA/%s", upper_name);
- SAFE_FREE( upper_name );
+ talloc_free(upper_name);
if (!centry)
goto do_query;