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:53:43 +0000 (12:53 +0100)
source/lib/util_pw.c

index 428378505f7a1a1230e7499bb2d6bd0b7ee534b3..342e50994e54d8250fb5e4b636d15ab8a555b6f9 100644 (file)
@@ -59,10 +59,7 @@ struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
 
        cached = tcopy_passwd(NULL, 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(name),