summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/idvec-impgids.c
diff options
context:
space:
mode:
Diffstat (limited to 'libshouldbeinlibc/idvec-impgids.c')
-rw-r--r--libshouldbeinlibc/idvec-impgids.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libshouldbeinlibc/idvec-impgids.c b/libshouldbeinlibc/idvec-impgids.c
index 21e6af1d..66f82e21 100644
--- a/libshouldbeinlibc/idvec-impgids.c
+++ b/libshouldbeinlibc/idvec-impgids.c
@@ -84,7 +84,11 @@ _merge_implied_gids (struct idvec *implied_gids, uid_t uid)
if (! cache)
err = ENOMEM;
else
- err = idvec_add_new (cache, pw->pw_gid);
+ {
+ err = idvec_add_new (cache, pw->pw_gid);
+ if (err)
+ idvec_free (cache);
+ }
#endif
if (! err)