[libfko] minor memory leak fix for user detection (corner case)

This commit is contained in:
Michael Rash 2012-07-29 21:31:44 -04:00
parent 6d379aba6e
commit df0f0b7f61

View File

@ -74,7 +74,11 @@ fko_set_username(fko_ctx_t ctx, const char *spoof_user)
/* if we still didn't get a username, fall back
*/
if((username = getenv("USER")) == NULL)
{
username = strdup("NO_USER");
if(username == NULL)
return(FKO_ERROR_MEMORY_ALLOCATION);
}
}
}