Skip to content

Commit 40ecad3

Browse files
committed
Fixed wrong usage of old ZPP API.
1 parent e511f15 commit 40ecad3

File tree

10 files changed

+14
-15
lines changed

10 files changed

+14
-15
lines changed

ext/curl/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
21112111
CURLcode error = CURLE_OK;
21122112
zend_long lval;
21132113

2114-
ZVAL_DEREF(zvalue);
21152114
switch (option) {
21162115
/* Long options */
21172116
case CURLOPT_SSL_VERIFYHOST:
@@ -2989,6 +2988,7 @@ PHP_FUNCTION(curl_setopt_array)
29892988
"Array keys must be CURLOPT constants or equivalent integer values");
29902989
RETURN_FALSE;
29912990
}
2991+
ZVAL_DEREF(entry);
29922992
if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) {
29932993
RETURN_FALSE;
29942994
}

ext/curl/multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ PHP_FUNCTION(curl_multi_info_read)
339339
RETURN_FALSE;
340340
}
341341
if (zmsgs_in_queue) {
342-
zval_dtor(zmsgs_in_queue);
342+
zval_ptr_dtor(zmsgs_in_queue);
343343
ZVAL_LONG(zmsgs_in_queue, queued_msgs);
344344
}
345345

ext/filter/logical_filters.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
314314
if (ret == -1) {
315315
RETURN_VALIDATION_FAILED
316316
} else {
317-
zval_dtor(value);
317+
zval_ptr_dtor(value);
318318
ZVAL_BOOL(value, ret);
319319
}
320320
}

ext/filter/sanitizing_filters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
213213
Z_STRLEN_P(value) = new_len;
214214

215215
if (new_len == 0) {
216-
zval_dtor(value);
216+
zval_ptr_dtor(value);
217217
if (flags & FILTER_FLAG_EMPTY_STRING_NULL) {
218218
ZVAL_NULL(value);
219219
} else {
@@ -293,7 +293,7 @@ void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
293293

294294
php_filter_encode_html(value, enc);
295295
} else if (flags & FILTER_FLAG_EMPTY_STRING_NULL && Z_STRLEN_P(value) == 0) {
296-
zval_dtor(value);
296+
zval_ptr_dtor(value);
297297
ZVAL_NULL(value);
298298
}
299299
}

ext/intl/converter/converter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
6262
/* {{{ php_converter_default_callback */
6363
static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
6464
ZVAL_DEREF(error);
65-
zval_dtor(error);
65+
zval_ptr_dtor(error);
6666
ZVAL_LONG(error, U_ZERO_ERROR);
6767
/* Basic functionality so children can call parent::toUCallback() */
6868
switch (reason) {

ext/intl/dateformat/dateformat_parse.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ PHP_FUNCTION(datefmt_parse)
135135
DATE_FORMAT_METHOD_INIT_VARS;
136136

137137
/* Parse parameters. */
138-
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!",
138+
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!",
139139
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
140140
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 );
141141
RETURN_FALSE;
@@ -145,7 +145,6 @@ PHP_FUNCTION(datefmt_parse)
145145
DATE_FORMAT_METHOD_FETCH_OBJECT;
146146

147147
if (z_parse_pos) {
148-
ZVAL_DEREF(z_parse_pos);
149148
convert_to_long(z_parse_pos);
150149
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
151150
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -159,7 +158,7 @@ PHP_FUNCTION(datefmt_parse)
159158
}
160159
internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
161160
if(z_parse_pos) {
162-
zval_dtor(z_parse_pos);
161+
zval_ptr_dtor(z_parse_pos);
163162
ZVAL_LONG(z_parse_pos, parse_pos);
164163
}
165164
}
@@ -189,7 +188,6 @@ PHP_FUNCTION(datefmt_localtime)
189188
DATE_FORMAT_METHOD_FETCH_OBJECT;
190189

191190
if (z_parse_pos) {
192-
ZVAL_DEREF(z_parse_pos);
193191
convert_to_long(z_parse_pos);
194192
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
195193
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -203,7 +201,7 @@ PHP_FUNCTION(datefmt_localtime)
203201
}
204202
internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
205203
if (z_parse_pos) {
206-
zval_dtor(z_parse_pos);
204+
zval_ptr_dtor(z_parse_pos);
207205
ZVAL_LONG(z_parse_pos, parse_pos);
208206
}
209207
}

ext/intl/grapheme/grapheme_string.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,7 @@ PHP_FUNCTION(grapheme_extract)
804804
} else {
805805
ZVAL_DEREF(next);
806806
/* initialize next */
807-
SEPARATE_ZVAL_NOREF(next);
808-
zval_dtor(next);
807+
zval_ptr_dtor(next);
809808
ZVAL_LONG(next, lstart);
810809
}
811810
}

ext/intl/spoofchecker/spoofchecker_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
4646
}
4747

4848
if (error_code) {
49-
zval_dtor(error_code);
49+
zval_ptr_dtor(error_code);
5050
ZVAL_LONG(error_code, ret);
5151
}
5252
RETVAL_BOOL(ret != 0);
@@ -81,7 +81,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
8181
}
8282

8383
if (error_code) {
84-
zval_dtor(error_code);
84+
zval_ptr_dtor(error_code);
8585
ZVAL_LONG(error_code, ret);
8686
}
8787
RETVAL_BOOL(ret != 0);

ext/soap/soap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,6 +2952,7 @@ PHP_METHOD(SoapClient, __call)
29522952
} ZEND_HASH_FOREACH_END();
29532953
}
29542954
if (output_headers) {
2955+
zval_ptr_dtor(output_headers);
29552956
array_init(output_headers);
29562957
}
29572958
do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers);

ext/sysvmsg/sysvmsg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ PHP_FUNCTION(msg_send)
469469
if (result == -1) {
470470
php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno));
471471
if (zerror) {
472+
zval_ptr_dtor(zerror);
472473
ZVAL_LONG(zerror, errno);
473474
}
474475
} else {

0 commit comments

Comments
 (0)