Fix usermod crash

Return newly allocated pointers when the caller will free them.

Closes #110
This commit is contained in:
fariouche
2018-05-08 21:17:46 -05:00
committed by Serge Hallyn
parent f50603a5fc
commit 73a876a056
2 changed files with 7 additions and 5 deletions

View File

@@ -333,7 +333,7 @@ extern struct group *prefix_getgr_nam_gid(const char *grname)
&& (gid == (gid_t)gid)) {
return prefix_getgrgid ((gid_t) gid);
}
return prefix_getgrnam (grname);
return __gr_dup(prefix_getgrnam (grname));
}
else
return getgr_nam_gid(grname);