Code

src/common.c: Allow the `pwbufp' argument to `getpwnam_r' to be NULL.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 1 Jul 2007 06:53:18 +0000 (08:53 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 1 Jul 2007 06:53:18 +0000 (08:53 +0200)
src/common.c

index 6333ab770db2ff6de93669387ce8c298ee096bae..9ebfe27cb60bc3cb56ae3317f084f69b4f8cf10d 100644 (file)
@@ -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);