Merge pull request #359 from ikerexxe/rest_resource_leak
Fix covscan RESOURCE_LEAK
This commit is contained in:
@@ -162,8 +162,9 @@ static void check_perms (const struct group *grp,
|
||||
*/
|
||||
spwd = xgetspnam (pwd->pw_name);
|
||||
if (NULL != spwd) {
|
||||
pwd->pw_passwd = spwd->sp_pwdp;
|
||||
pwd->pw_passwd = xstrdup (spwd->sp_pwdp);
|
||||
}
|
||||
spw_free (spwd);
|
||||
|
||||
if ((pwd->pw_passwd[0] == '\0') && (grp->gr_passwd[0] != '\0')) {
|
||||
needspasswd = true;
|
||||
|
@@ -553,6 +553,11 @@ static char *update_crypt_pw (char *cp)
|
||||
|
||||
strcpy (newpw, "!");
|
||||
strcat (newpw, cp);
|
||||
#ifndef USE_PAM
|
||||
if (do_update_pwd) {
|
||||
free (cp);
|
||||
}
|
||||
#endif /* USE_PAM */
|
||||
cp = newpw;
|
||||
}
|
||||
return cp;
|
||||
|
Reference in New Issue
Block a user