]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3' into PHP-7.4
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 12 Mar 2020 10:27:30 +0000 (11:27 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Thu, 12 Mar 2020 10:27:45 +0000 (11:27 +0100)
* PHP-7.3:
  Fix #79199: curl_copy_handle() memory leak

1  2 
NEWS
ext/curl/interface.c

diff --cc NEWS
Simple merge
index 45e41ba49ecbe75d784cf284e0cd9a06a30e1cdb,630d3b0a89664ca54516cda9cdb14bdcaf99008b..7d57df8f7825f9641ac41d98778264463e515e7f
@@@ -2356,19 -2167,6 +2356,17 @@@ PHP_FUNCTION(curl_copy_handle
  
        _php_setup_easy_copy_handlers(dupch, ch);
  
-       Z_ADDREF_P(zid);
 +#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
 +      postfields = &ch->postfields;
 +      if (Z_TYPE_P(postfields) != IS_UNDEF) {
 +              if (build_mime_structure_from_hash(dupch, postfields) != SUCCESS) {
 +                      _php_curl_close_ex(dupch);
 +                      php_error_docref(NULL, E_WARNING, "Cannot rebuild mime structure");
 +                      RETURN_FALSE;
 +              }
 +      }
 +#endif
 +
        ZVAL_RES(return_value, zend_register_resource(dupch, le_curl));
        dupch->res = Z_RES_P(return_value);
  }