Skip to content

Commit b57d558

Browse files
committed
Fix proc_open resource destruction
1 parent 2a31934 commit b57d558

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/standard/proc_open.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ static void proc_open_rsrc_dtor(zend_resource *rsrc TSRMLS_DC)
222222
/* Close all handles to avoid a deadlock */
223223
for (i = 0; i < proc->npipes; i++) {
224224
if (proc->pipes[i] != 0) {
225-
zend_list_delete(proc->pipes[i]);
225+
GC_REFCOUNT(proc->pipes[i])--;
226+
zend_list_close(proc->pipes[i]);
226227
proc->pipes[i] = 0;
227228
}
228229
}
@@ -318,7 +319,7 @@ PHP_FUNCTION(proc_close)
318319
ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, zproc, -1, "process", le_proc_open);
319320

320321
FG(pclose_wait) = 1;
321-
zend_list_delete(Z_RES_P(zproc));
322+
zend_list_close(Z_RES_P(zproc));
322323
FG(pclose_wait) = 0;
323324
RETURN_LONG(FG(pclose_ret));
324325
}

0 commit comments

Comments
 (0)