Skip to content

Commit 454d297

Browse files
committed
Fix gidlist allocation leak on error
1 parent 7a8ffce commit 454d297

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/posix/posix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ PHP_FUNCTION(posix_getgroups)
579579
gidlist = emalloc(sizeof(gid_t) * result);
580580
if ((result = getgroups(result, gidlist)) < 0) {
581581
POSIX_G(last_error) = errno;
582+
efree(gidlist);
582583
RETURN_FALSE;
583584
}
584585

0 commit comments

Comments
 (0)