From: Volker Lendecke Date: Fri, 14 Nov 2008 11:49:18 +0000 (+0100) Subject: sys_pwnam doesn't return talloced memory, so don't mix up the returned struct. X-Git-Tag: samba-4.0.0alpha6~480^2~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b41f670fc40ac583f546440c2a683e94eb05caf;p=thirdparty%2Fsamba.git sys_pwnam doesn't return talloced memory, so don't mix up the returned struct. (cherry picked from commit eb99923991960e53bd150ac8f1d818cb746101b4) --- diff --git a/source3/lib/util_pw.c b/source3/lib/util_pw.c index e0dbc97f005..e138273e8b1 100644 --- a/source3/lib/util_pw.c +++ b/source3/lib/util_pw.c @@ -59,10 +59,7 @@ struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name) cached = tcopy_passwd(talloc_autofree_context(), temp); if (cached == NULL) { - /* - * Just don't add this into the cache, ignore the failure - */ - return temp; + return NULL; } memcache_add_talloc(NULL, GETPWNAM_CACHE, data_blob_string_const_null(name),