diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-02 10:31:16 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-02 10:31:16 +0100 |
commit | 54fa0a69f8c5e9a97c46e74c6bf7bab1b2b02465 (patch) | |
tree | 055001c14d781d71d717306362d45fc16078da4e | |
parent | 51d76c346e1a22bc711c74a231b58a495f2fb42c (diff) | |
download | php-git-54fa0a69f8c5e9a97c46e74c6bf7bab1b2b02465.tar.gz |
Add missing derefs in CurlFile
As pointed out on GH-6456.
-rw-r--r-- | ext/curl/interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 7faf439ce1..343e539777 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2207,6 +2207,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields #endif prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0, &rv); + ZVAL_DEREF(prop); if (Z_TYPE_P(prop) != IS_STRING) { php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", ZSTR_VAL(string_key)); } else { @@ -2217,10 +2218,12 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields } prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0, &rv); + ZVAL_DEREF(prop); if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) { type = Z_STRVAL_P(prop); } prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0, &rv); + ZVAL_DEREF(prop); if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) { filename = Z_STRVAL_P(prop); } |