]> granicus.if.org Git - shadow/commitdiff
* libmisc/find_new_uid.c: free (used_uids) on return.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Jul 2011 01:38:07 +0000 (01:38 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Jul 2011 01:38:07 +0000 (01:38 +0000)
* libmisc/find_new_gid.c: free (used_gids) on return.

ChangeLog
libmisc/find_new_gid.c
libmisc/find_new_uid.c

index 339f2b4d7b485c849166c3cba5edc4add3f12e68..964cd958d1f8e2b5819734089c37b24114d51607 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index f3496499ee24bb343a23394e51cabe19740616ee..d3e51a4b1ab3bcfcfbdf064bb508bc4b57cea1c3 100644 (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;
                        }
                }
index 318820552ca8019481a859309fc500cb6ca6b01e..aac1909c51d6870d31b2dd544ddf089a5560ef82 100644 (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;
                        }
                }