cvs: php-src /ext/pcntl pcntl.c

From: Date: Tue, 30 May 2006 17:44:23 +0000
Subject: cvs: php-src /ext/pcntl pcntl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-38513@lists.php.net to get a copy of this message
mike Tue May 30 17:44:23 2006 UTC Modified files: /php-src/ext/pcntl pcntl.c Log: MFB: fix bug 37635 (argument to pcntl signal handler is trashed) http://cvs.php.net/viewcvs.cgi/php-src/ext/pcntl/pcntl.c?r1=1.53&r2=1.54&diff_format=u Index: php-src/ext/pcntl/pcntl.c diff -u php-src/ext/pcntl/pcntl.c:1.53 php-src/ext/pcntl/pcntl.c:1.54 --- php-src/ext/pcntl/pcntl.c:1.53 Thu Apr 27 15:28:21 2006 +++ php-src/ext/pcntl/pcntl.c Tue May 30 17:44:23 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pcntl.c,v 1.53 2006/04/27 15:28:21 andrei Exp $ */ +/* $Id: pcntl.c,v 1.54 2006/05/30 17:44:23 mike Exp $ */ #define PCNTL_DEBUG 0 @@ -693,16 +693,19 @@ PCNTL_G(head) = NULL; /* simple stores are atomic */ /* Allocate */ - MAKE_STD_ZVAL(param); - MAKE_STD_ZVAL(retval); while (queue) { if (zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo, (void **) &handle)==SUCCESS) { + MAKE_STD_ZVAL(retval); + MAKE_STD_ZVAL(param); + ZVAL_NULL(retval); ZVAL_LONG(param, queue->signo); /* Call php signal handler - Note that we do not report errors, and we ignore the return value */ /* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */ call_user_function(EG(function_table), NULL, *handle, retval, 1, &param TSRMLS_CC); + zval_ptr_dtor(&param); + zval_ptr_dtor(&retval); } next = queue->next; @@ -713,10 +716,6 @@ /* Re-enable queue */ PCNTL_G(processing_signal_queue) = 0; - - /* Clean up */ - efree(param); - efree(retval); }

« previous php.cvs (#38513) next »