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 6333ab7..9ebfe27 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);