1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

winbind: Use talloc in resolve_alias_to_username().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Andreas Schneider 2012-12-06 11:24:17 +01:00 committed by Günther Deschner
parent c9053796b3
commit d862bbd5dc

View File

@ -1189,16 +1189,18 @@ NTSTATUS resolve_alias_to_username( TALLOC_CTX *mem_ctx,
if (!cache->tdb)
goto do_query;
if ( (upper_name = SMB_STRDUP(alias)) == NULL )
upper_name = talloc_strdup(mem_ctx, alias);
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/AN/%s", upper_name);
SAFE_FREE( upper_name );
talloc_free(upper_name);
if (!centry)
goto do_query;