]> granicus.if.org Git - php/commitdiff
Fixed wrong usage of old ZPP API.
authorDmitry Stogov <dmitry@zend.com>
Mon, 19 Jun 2017 15:08:50 +0000 (18:08 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 19 Jun 2017 15:08:50 +0000 (18:08 +0300)
ext/curl/interface.c
ext/curl/multi.c
ext/filter/logical_filters.c
ext/filter/sanitizing_filters.c
ext/intl/converter/converter.c
ext/intl/dateformat/dateformat_parse.c
ext/intl/grapheme/grapheme_string.c
ext/intl/spoofchecker/spoofchecker_main.c
ext/soap/soap.c
ext/sysvmsg/sysvmsg.c

index 21f1f71455aa3637682ee3cc0bd5c4058b57ae7d..3684222f9339cc0de3181bfdfde3a45b571122d5 100644 (file)
@@ -2111,7 +2111,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
        CURLcode error = CURLE_OK;
        zend_long lval;
 
-       ZVAL_DEREF(zvalue);
        switch (option) {
                /* Long options */
                case CURLOPT_SSL_VERIFYHOST:
@@ -2989,6 +2988,7 @@ PHP_FUNCTION(curl_setopt_array)
                                        "Array keys must be CURLOPT constants or equivalent integer values");
                        RETURN_FALSE;
                }
+               ZVAL_DEREF(entry);
                if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) {
                        RETURN_FALSE;
                }
index 322fd823f421246e258a616c5cf047dc172dfe3f..d45802f71da6f77be3da3cd3baaf466eb59b6edc 100644 (file)
@@ -339,7 +339,7 @@ PHP_FUNCTION(curl_multi_info_read)
                RETURN_FALSE;
        }
        if (zmsgs_in_queue) {
-               zval_dtor(zmsgs_in_queue);
+               zval_ptr_dtor(zmsgs_in_queue);
                ZVAL_LONG(zmsgs_in_queue, queued_msgs);
        }
 
index 4a01f3138488e18fb12a892e327fb2ffaf9d58bf..c203adc910e4fb09a4dcf82ac5be64102ebd3c38 100644 (file)
@@ -314,7 +314,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
        if (ret == -1) {
                RETURN_VALIDATION_FAILED
        } else {
-               zval_dtor(value);
+               zval_ptr_dtor(value);
                ZVAL_BOOL(value, ret);
        }
 }
index a4bcc0f18af220d05a08c1cbf1493950155b3d05..299902fe5808cd4361a4e61d3f5756f832b03a1a 100644 (file)
@@ -213,7 +213,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
        Z_STRLEN_P(value) = new_len;
 
        if (new_len == 0) {
-               zval_dtor(value);
+               zval_ptr_dtor(value);
                if (flags & FILTER_FLAG_EMPTY_STRING_NULL) {
                        ZVAL_NULL(value);
                } else {
@@ -293,7 +293,7 @@ void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
 
                php_filter_encode_html(value, enc);
        } else if (flags & FILTER_FLAG_EMPTY_STRING_NULL && Z_STRLEN_P(value) == 0) {
-               zval_dtor(value);
+               zval_ptr_dtor(value);
                ZVAL_NULL(value);
        }
 }
index ede61fc80a476f4be31d41cba0e974c19ba0ff68..f3201c7e4677ad043bdef0484cf6f9cd2f0b4bdd 100644 (file)
@@ -62,7 +62,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
 /* {{{ php_converter_default_callback */
 static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
        ZVAL_DEREF(error);
-       zval_dtor(error);
+       zval_ptr_dtor(error);
        ZVAL_LONG(error, U_ZERO_ERROR);
        /* Basic functionality so children can call parent::toUCallback() */
        switch (reason) {
index a8331777bb0ceb6016dda4189a323f12bf5d4850..0e2290ffa171b4f8fbd958ddd63cadc0d16fa21f 100644 (file)
@@ -135,7 +135,7 @@ PHP_FUNCTION(datefmt_parse)
        DATE_FORMAT_METHOD_INIT_VARS;
 
        /* Parse parameters. */
-       if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!",
+       if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!",
                &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
                intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 );
                RETURN_FALSE;
@@ -145,7 +145,6 @@ PHP_FUNCTION(datefmt_parse)
        DATE_FORMAT_METHOD_FETCH_OBJECT;
 
        if (z_parse_pos) {
-               ZVAL_DEREF(z_parse_pos);
                convert_to_long(z_parse_pos);
                if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
                        intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -159,7 +158,7 @@ PHP_FUNCTION(datefmt_parse)
        }
        internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
        if(z_parse_pos) {
-               zval_dtor(z_parse_pos);
+               zval_ptr_dtor(z_parse_pos);
                ZVAL_LONG(z_parse_pos, parse_pos);
        }
 }
@@ -189,7 +188,6 @@ PHP_FUNCTION(datefmt_localtime)
        DATE_FORMAT_METHOD_FETCH_OBJECT;
 
        if (z_parse_pos) {
-               ZVAL_DEREF(z_parse_pos);
                convert_to_long(z_parse_pos);
                if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
                        intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -203,7 +201,7 @@ PHP_FUNCTION(datefmt_localtime)
        }
        internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
        if (z_parse_pos) {
-               zval_dtor(z_parse_pos);
+               zval_ptr_dtor(z_parse_pos);
                ZVAL_LONG(z_parse_pos, parse_pos);
        }
 }
index 91d5741ea1b4dbdd5edad1aa322486ca46539e35..fd0327939011471c72f1d22795efcea131b0886b 100644 (file)
@@ -804,8 +804,7 @@ PHP_FUNCTION(grapheme_extract)
                } else {
                        ZVAL_DEREF(next);
                        /* initialize next */
-                       SEPARATE_ZVAL_NOREF(next);
-                       zval_dtor(next);
+                       zval_ptr_dtor(next);
             ZVAL_LONG(next, lstart);
                }
        }
index cb26905305c56f88b246067a4205c66bb540fefc..5e1d75ddad718bb928d6a2facd4a2e943da0f630 100644 (file)
@@ -46,7 +46,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
        }
 
        if (error_code) {
-               zval_dtor(error_code);
+               zval_ptr_dtor(error_code);
                ZVAL_LONG(error_code, ret);
        }
        RETVAL_BOOL(ret != 0);
@@ -81,7 +81,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
        }
 
        if (error_code) {
-               zval_dtor(error_code);
+               zval_ptr_dtor(error_code);
                ZVAL_LONG(error_code, ret);
        }
        RETVAL_BOOL(ret != 0);
index c874629e38d710f784635d1de91c76456f9a58fe..68b61304b8635d5bb1503efdd3c09800c6a820c5 100644 (file)
@@ -2952,6 +2952,7 @@ PHP_METHOD(SoapClient, __call)
                } ZEND_HASH_FOREACH_END();
        }
        if (output_headers) {
+               zval_ptr_dtor(output_headers);
                array_init(output_headers);
        }
        do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers);
index 37aa0d90288b1385356784f17694f4c700575736..8fc76436c42ce984b2ad34ae6b27082d5e66c104 100644 (file)
@@ -469,6 +469,7 @@ PHP_FUNCTION(msg_send)
        if (result == -1) {
                php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno));
                if (zerror) {
+                       zval_ptr_dtor(zerror);
                        ZVAL_LONG(zerror, errno);
                }
        } else {