From d862bbd5dcffa3f1cb8e774724132a39b55dbd9f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Dec 2012 11:24:17 +0100 Subject: winbind: Use talloc in resolve_alias_to_username(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source3/winbindd/winbindd_cache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index e3406a5858f..ffed27b3976 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -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; -- cgit v1.2.1