summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
commit4a475a4976db92e71949786cdf5990c61514261e (patch)
tree6934c9e00200e6388256656b8fa71c97a1a3a158 /ext/pgsql
parentd798fd491be77943fb751ad97d85475bf324192c (diff)
downloadphp-git-4a475a4976db92e71949786cdf5990c61514261e.tar.gz
Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index a979ab5182..a75abf965c 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -2911,7 +2911,7 @@ PHP_FUNCTION(pg_fetch_all)
pgsql_result = pg_result->result;
array_init(return_value);
if (php_pgsql_result2array(pgsql_result, return_value, result_type) == FAILURE) {
- zval_dtor(return_value);
+ zend_array_destroy(Z_ARR_P(return_value));
RETURN_FALSE;
}
}
@@ -4278,12 +4278,12 @@ PHP_FUNCTION(pg_copy_from)
}
if (PQputCopyData(pgsql, query, (int)strlen(query)) != 1) {
efree(query);
- zval_dtor(&tmp);
+ zval_ptr_dtor_str(&tmp);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
- zval_dtor(&tmp);
+ zval_ptr_dtor_str(&tmp);
} ZEND_HASH_FOREACH_END();
if (PQputCopyEnd(pgsql, NULL) != 1) {
@@ -4302,12 +4302,12 @@ PHP_FUNCTION(pg_copy_from)
}
if (PQputline(pgsql, query)==EOF) {
efree(query);
- zval_dtor(&tmp);
+ zval_ptr_dtor_str(&tmp);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
- zval_dtor(&tmp);
+ zval_ptr_dtor_str(&tmp);
} ZEND_HASH_FOREACH_END();
if (PQputline(pgsql, "\\.\n") == EOF) {
@@ -5636,7 +5636,7 @@ PHP_FUNCTION(pg_meta_data)
array_init(return_value);
if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) {
- zval_dtor(return_value); /* destroy array */
+ zend_array_destroy(Z_ARR_P(return_value)); /* destroy array */
RETURN_FALSE;
}
}
@@ -6520,7 +6520,7 @@ PHP_FUNCTION(pg_convert)
}
array_init(return_value);
if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) {
- zval_dtor(return_value);
+ zend_array_destroy(Z_ARR_P(return_value));
RETURN_FALSE;
}
}