com php-src: Fix memory leak: ext/pcntl/pcntl.c

From: Date: Fri, 08 Jul 2016 03:33:01 +0000
Subject: com php-src: Fix memory leak: ext/pcntl/pcntl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93265@lists.php.net to get a copy of this message
Commit: cc16eff7ad89e61ce732329b7b3ddddcd418fc54 Author: David Walker <dave@mudsite.com> Thu, 7 Jul 2016 15:35:09 -0600 Parents: f64388e8c1686948d88401ae9871c87cb012b65f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc16eff7ad89e61ce732329b7b3ddddcd418fc54 Log: Fix memory leak Changed paths: M ext/pcntl/pcntl.c Diff: diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b8f75e5..8c6105a 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -560,6 +560,11 @@ PHP_RSHUTDOWN_FUNCTION(pcntl) while (PCNTL_G(head)) { sig = PCNTL_G(head); PCNTL_G(head) = sig->next; +#ifdef HAVE_STRUCT_SIGINFO_T + if (sig->siginfo) { + zend_array_destroy(sig->siginfo); + } +#endif efree(sig); } while (PCNTL_G(spares)) { @@ -1375,10 +1380,10 @@ static void pcntl_signal_handler(int signo) #ifdef HAVE_STRUCT_SIGINFO_T zval user_siginfo; - ZVAL_NEW_ARR(&user_siginfo); array_init(&user_siginfo); pcntl_siginfo_to_zval(signo, siginfo, &user_siginfo); - psig->siginfo = Z_ARRVAL(user_siginfo); + psig->siginfo = zend_array_dup(Z_ARRVAL(user_siginfo)); + zval_ptr_dtor(&user_siginfo); #endif /* the head check is important, as the tick handler cannot atomically clear both

« previous php.cvs (#93265) next »