summaryrefslogtreecommitdiff
path: root/ext/pcntl
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-05 10:57:49 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-05 10:57:49 +0300
commit265c3ed6cfd05b78fb65187f18b3e1ecb560c242 (patch)
tree55601eaa8fa113bba16538ef475420c38f92e3b1 /ext/pcntl
parent587ab006984dae0ecee2c8eb41f08d3da155d7ef (diff)
downloadphp-git-265c3ed6cfd05b78fb65187f18b3e1ecb560c242.tar.gz
Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks.
Diffstat (limited to 'ext/pcntl')
-rw-r--r--ext/pcntl/pcntl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 6c873a2619..013d74054b 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -674,7 +674,7 @@ PHP_FUNCTION(pcntl_waitpid)
#ifdef HAVE_WAIT4
if (z_rusage) {
if (Z_TYPE_P(z_rusage) != IS_ARRAY) {
- zval_dtor(z_rusage);
+ zval_ptr_dtor(z_rusage);
array_init(z_rusage);
} else {
zend_hash_clean(Z_ARRVAL_P(z_rusage));
@@ -699,7 +699,7 @@ PHP_FUNCTION(pcntl_waitpid)
}
#endif
- zval_dtor(z_status);
+ zval_ptr_dtor(z_status);
ZVAL_LONG(z_status, status);
RETURN_LONG((zend_long) child_id);
@@ -726,7 +726,7 @@ PHP_FUNCTION(pcntl_wait)
#ifdef HAVE_WAIT3
if (z_rusage) {
if (Z_TYPE_P(z_rusage) != IS_ARRAY) {
- zval_dtor(z_rusage);
+ zval_ptr_dtor(z_rusage);
array_init(z_rusage);
} else {
zend_hash_clean(Z_ARRVAL_P(z_rusage));
@@ -752,7 +752,7 @@ PHP_FUNCTION(pcntl_wait)
}
#endif
- zval_dtor(z_status);
+ zval_ptr_dtor(z_status);
ZVAL_LONG(z_status, status);
RETURN_LONG((zend_long) child_id);
@@ -1134,7 +1134,7 @@ PHP_FUNCTION(pcntl_sigprocmask)
if (user_oldset != NULL) {
if (Z_TYPE_P(user_oldset) != IS_ARRAY) {
- zval_dtor(user_oldset);
+ zval_ptr_dtor(user_oldset);
array_init(user_oldset);
} else {
zend_hash_clean(Z_ARRVAL_P(user_oldset));
@@ -1233,7 +1233,7 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi
{
if (signo > 0 && user_siginfo) {
if (Z_TYPE_P(user_siginfo) != IS_ARRAY) {
- zval_dtor(user_siginfo);
+ zval_ptr_dtor(user_siginfo);
array_init(user_siginfo);
} else {
zend_hash_clean(Z_ARRVAL_P(user_siginfo));