From 8811547c33ae23324d350919436c4ace1a795ca9 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 1 Jul 2007 08:53:18 +0200 Subject: [PATCH] src/common.c: Allow the `pwbufp' argument to `getpwnam_r' to be NULL. --- src/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 6333ab77..9ebfe27c 100644 --- a/src/common.c +++ b/src/common.c @@ -695,7 +695,8 @@ int getpwnam_r (const char *name, struct passwd *pwbuf, char *buf, pwbuf->pw_uid = pw->pw_uid; pwbuf->pw_gid = pw->pw_gid; - *pwbufp = pwbuf; + if (pwbufp != NULL) + *pwbufp = pwbuf; } while (0); pthread_mutex_unlock (&getpwnam_r_lock); -- 2.30.2