null check auth current user get

CID 1155286
This commit is contained in:
Mike Blumenkrantz 2014-03-13 12:06:04 -04:00
parent 865dc17221
commit 3f3322cb9c
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@ _auth_auth_get_current_user(void)
struct passwd *pwent = NULL;
pwent = getpwuid(getuid());
if (!pwent) return NULL;
user = strdup(pwent->pw_name);
return user;
}