mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 07:51:21 +03:00
user-util: fix use after free() on error path
Fixes CID#1412356.
This commit is contained in:
parent
b44b735a78
commit
4af8ab2cab
@ -496,11 +496,9 @@ int getgroups_alloc(gid_t** gids) {
|
||||
|
||||
free(allocated);
|
||||
|
||||
allocated = new(gid_t, ngroups);
|
||||
p = allocated = new(gid_t, ngroups);
|
||||
if (!allocated)
|
||||
return -ENOMEM;
|
||||
|
||||
p = allocated;
|
||||
}
|
||||
|
||||
*gids = TAKE_PTR(p);
|
||||
|
Loading…
Reference in New Issue
Block a user