From b9f99dd3c5eeadfc7d064dc197a42f93afb174b0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 14 Nov 2008 12:49:18 +0100 Subject: [PATCH] sys_pwnam doesn't return talloced memory, so don't mix up the returned struct. (cherry picked from commit eb99923991960e53bd150ac8f1d818cb746101b4) (cherry picked from commit a1c1c381ab2bb3a142d277971a89cfd8833b3e80) --- source/lib/util_pw.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/lib/util_pw.c b/source/lib/util_pw.c index 4f2a0327413..e6abd05998b 100644 --- a/source/lib/util_pw.c +++ b/source/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(name), -- 2.11.4.GIT