summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorPierrick Charron <pierrick@php.net>2012-08-16 14:48:44 -0400
committerPierrick Charron <pierrick@php.net>2012-08-16 14:48:44 -0400
commit9cf0139460c7531ebe8fdd523ba6cf7067a7f282 (patch)
treea2f4629f2f0aa4ca842af853ac6e4c7ad2729d1c /ext/curl/interface.c
parent8649e4236b12ce9b90356a5804be96bd1f67bcd6 (diff)
downloadphp-git-9cf0139460c7531ebe8fdd523ba6cf7067a7f282.tar.gz
Fixed bug #62839
curl_copy_handle segfault with CURLOPT_FILE. The refcount was incremented before the assignement.
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 94be60fd5d..7b72873038 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1610,9 +1610,9 @@ PHP_FUNCTION(curl_copy_handle)
dupch->uses = 0;
ch->uses++;
if (ch->handlers->write->stream) {
- Z_ADDREF_P(dupch->handlers->write->stream);
- dupch->handlers->write->stream = ch->handlers->write->stream;
+ Z_ADDREF_P(ch->handlers->write->stream);
}
+ dupch->handlers->write->stream = ch->handlers->write->stream;
dupch->handlers->write->method = ch->handlers->write->method;
dupch->handlers->write->type = ch->handlers->write->type;
if (ch->handlers->read->stream) {