summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-05-13 13:18:00 +0400
committerDmitry Stogov <dmitry@zend.com>2014-05-13 13:18:00 +0400
commitb8b8c497c4b9d6deceee0b287fd7630f79f7f4ea (patch)
tree84d30e04a53a93b967ae57e27e92be306fd9fc55
parentf1720348ca7cfea9e88a294faf0ec077c66786f1 (diff)
downloadphp-git-b8b8c497c4b9d6deceee0b287fd7630f79f7f4ea.tar.gz
In most user extensions functions like mysql_close() should use zend_list_close() instead of zend_list_delete(). This closes the actual connection and frees extension specific data structures, but doesn't free zend_reference structure that might be referenced from zval(s). This also doesn't decrement the resource reference counter.
-rw-r--r--ext/curl/interface.c2
-rw-r--r--ext/gd/gd.c2
-rw-r--r--ext/mcrypt/mcrypt.c4
-rw-r--r--ext/sysvshm/sysvshm.c2
-rw-r--r--ext/wddx/wddx.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 5ba7797280..48fc27a8f2 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -3136,7 +3136,7 @@ PHP_FUNCTION(curl_close)
return;
}
- zend_list_delete(Z_RES_P(zid));
+ zend_list_close(Z_RES_P(zid));
}
/* }}} */
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index f4245b93fd..54cf68edce 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -4011,7 +4011,7 @@ PHP_FUNCTION(imagepsfreefont)
}
ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font);
- zend_list_delete(Z_LVAL_P(fnt));
+ zend_list_close(Z_RES_P(fnt));
RETURN_TRUE;
}
/* }}} */
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 9183ed9b9f..84b0c9248c 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -588,7 +588,7 @@ PHP_FUNCTION(mcrypt_generic_init)
/* If this function fails, close the mcrypt module to prevent crashes
* when further functions want to access this resource */
if (result < 0) {
- zend_list_delete(Z_RES_P(mcryptind));
+ zend_list_close(Z_RES_P(mcryptind));
switch (result) {
case -3:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect");
@@ -733,7 +733,7 @@ PHP_FUNCTION(mcrypt_enc_self_test)
PHP_FUNCTION(mcrypt_module_close)
{
MCRYPT_GET_TD_ARG
- zend_list_delete(Z_RES_P(mcryptind));
+ zend_list_close(Z_RES_P(mcryptind));
RETURN_TRUE;
}
/* }}} */
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index b6e27ffbb1..bb908a4113 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -212,7 +212,7 @@ PHP_FUNCTION(shm_detach)
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
- RETURN_BOOL(SUCCESS == zend_list_delete(Z_RES_P(shm_id)));
+ RETURN_BOOL(SUCCESS == zend_list_close(Z_RES_P(shm_id)));
}
/* }}} */
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index f383603803..699bad054c 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -1187,7 +1187,7 @@ PHP_FUNCTION(wddx_packet_end)
RETVAL_STR(STR_COPY(packet->s));
- zend_list_delete(Z_RES_P(packet_id));
+ zend_list_close(Z_RES_P(packet_id));
}
/* }}} */