main: fix possible NULL ptr on startup

This commit is contained in:
Adam Sutton 2013-02-09 12:48:57 +00:00
parent efd2c28b89
commit 74c9b4ecb1

View file

@ -514,7 +514,7 @@ main(int argc, char **argv)
gid_t gid;
uid_t uid;
struct group *grp = getgrnam(opt_group ?: "video");
struct passwd *pw = getpwnam(opt_user) ?: NULL;
struct passwd *pw = opt_user ? getpwnam(opt_user) : NULL;
FILE *pidfile = fopen(opt_pidpath, "w+");
if(grp != NULL) {