diff options
Diffstat (limited to 'uidswap.c')
-rw-r--r-- | uidswap.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -90,8 +90,7 @@ temporarily_use_uid(struct passwd *pw) | |||
90 | if (getgroups(saved_egroupslen, saved_egroups) < 0) | 90 | if (getgroups(saved_egroupslen, saved_egroups) < 0) |
91 | fatal("getgroups: %.100s", strerror(errno)); | 91 | fatal("getgroups: %.100s", strerror(errno)); |
92 | } else { /* saved_egroupslen == 0 */ | 92 | } else { /* saved_egroupslen == 0 */ |
93 | if (saved_egroups != NULL) | 93 | free(saved_egroups); |
94 | xfree(saved_egroups); | ||
95 | } | 94 | } |
96 | 95 | ||
97 | /* set and save the user's groups */ | 96 | /* set and save the user's groups */ |
@@ -109,8 +108,7 @@ temporarily_use_uid(struct passwd *pw) | |||
109 | if (getgroups(user_groupslen, user_groups) < 0) | 108 | if (getgroups(user_groupslen, user_groups) < 0) |
110 | fatal("getgroups: %.100s", strerror(errno)); | 109 | fatal("getgroups: %.100s", strerror(errno)); |
111 | } else { /* user_groupslen == 0 */ | 110 | } else { /* user_groupslen == 0 */ |
112 | if (user_groups) | 111 | free(user_groups); |
113 | xfree(user_groups); | ||
114 | } | 112 | } |
115 | } | 113 | } |
116 | /* Set the effective uid to the given (unprivileged) uid. */ | 114 | /* Set the effective uid to the given (unprivileged) uid. */ |