diff --git a/src/basic/user-util.c b/src/basic/user-util.c index 68c6dd0da7..6d22fe31c3 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -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);