From: Florian Forster Date: Sun, 1 Jul 2007 06:53:18 +0000 (+0200) Subject: src/common.c: Allow the `pwbufp' argument to `getpwnam_r' to be NULL. X-Git-Tag: collectd-4.0.5~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8811547c33ae23324d350919436c4ace1a795ca9;p=collectd.git src/common.c: Allow the `pwbufp' argument to `getpwnam_r' to be NULL. --- 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);