sys_pwnam doesn't return talloced memory, so don't mix up the returned struct.
authorVolker Lendecke <vl@samba.org>
Fri, 14 Nov 2008 11:49:18 +0000 (12:49 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Nov 2008 11:57:18 +0000 (12:57 +0100)
(cherry picked from commit eb99923991960e53bd150ac8f1d818cb746101b4)

source3/lib/util_pw.c

index e0dbc97f0056093461ac676026662e5560093d42..e138273e8b15884ade8701098c1a4f2814ae7528 100644 (file)
@@ -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),