Skip to content

Commit 54fa0a6

Browse files
committed
Add missing derefs in CurlFile
As pointed out on GH-6456.
1 parent 51d76c3 commit 54fa0a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/curl/interface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
22072207
#endif
22082208

22092209
prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0, &rv);
2210+
ZVAL_DEREF(prop);
22102211
if (Z_TYPE_P(prop) != IS_STRING) {
22112212
php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", ZSTR_VAL(string_key));
22122213
} else {
@@ -2217,10 +2218,12 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
22172218
}
22182219

22192220
prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0, &rv);
2221+
ZVAL_DEREF(prop);
22202222
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
22212223
type = Z_STRVAL_P(prop);
22222224
}
22232225
prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0, &rv);
2226+
ZVAL_DEREF(prop);
22242227
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
22252228
filename = Z_STRVAL_P(prop);
22262229
}

0 commit comments

Comments
 (0)