From 019048c55550cc03e88789788c42c4b058e36d93 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 30 Jul 2011 01:38:07 +0000 Subject: [PATCH] * libmisc/find_new_uid.c: free (used_uids) on return. * libmisc/find_new_gid.c: free (used_gids) on return. --- ChangeLog | 5 +++++ libmisc/find_new_gid.c | 3 +++ libmisc/find_new_uid.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 339f2b4d..964cd958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-30 Nicolas François + + * 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 * lib/commonio.c: Fix NIS commit from 2011-07-14. diff --git a/libmisc/find_new_gid.c b/libmisc/find_new_gid.c index f3496499..d3e51a4b 100644 --- a/libmisc/find_new_gid.c +++ b/libmisc/find_new_gid.c @@ -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; } } diff --git a/libmisc/find_new_uid.c b/libmisc/find_new_uid.c index 31882055..aac1909c 100644 --- a/libmisc/find_new_uid.c +++ b/libmisc/find_new_uid.c @@ -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; } }