* libmisc/find_new_uid.c: free (used_uids) on return.

* libmisc/find_new_gid.c: free (used_gids) on return.
This commit is contained in:
nekral-guest 2011-07-30 01:38:07 +00:00
parent 6223c40c2d
commit 019048c555
3 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-07-30 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/find_new_uid.c: free (used_uids) on return.
* libmisc/find_new_gid.c: free (used_gids) on return.
2011-07-28 Nicolas François <nicolas.francois@centraliens.net>
* lib/commonio.c: Fix NIS commit from 2011-07-14.

View File

@ -96,6 +96,7 @@ int find_new_gid (bool sys_group,
* changes */
&& (gr_locate_gid (*preferred_gid) == NULL)) {
*gid = *preferred_gid;
free (used_gids);
return 0;
}
@ -179,6 +180,7 @@ int find_new_gid (bool sys_group,
Prog);
SYSLOG ((LOG_WARN,
"no more available GID on the system"));
free (used_gids);
return -1;
}
}
@ -194,6 +196,7 @@ int find_new_gid (bool sys_group,
_("%s: Can't get unique GID (no more available GIDs)\n"),
Prog);
SYSLOG ((LOG_WARN, "no more available GID on the system"));
free (used_gids);
return -1;
}
}

View File

@ -96,6 +96,7 @@ int find_new_uid (bool sys_user,
* changes */
&& (pw_locate_uid (*preferred_uid) == NULL)) {
*uid = *preferred_uid;
free (used_uids);
return 0;
}
@ -179,6 +180,7 @@ int find_new_uid (bool sys_user,
Prog);
SYSLOG ((LOG_WARN,
"no more available UID on the system"));
free (used_uids);
return -1;
}
}
@ -194,6 +196,7 @@ int find_new_uid (bool sys_user,
_("%s: Can't get unique UID (no more available UIDs)\n"),
Prog);
SYSLOG ((LOG_WARN, "no more available UID on the system"));
free (used_uids);
return -1;
}
}