summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/curl/interface.c3
-rw-r--r--ext/curl/multi.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 3e76531a90..440f4e3c4f 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1291,12 +1291,13 @@ PHP_FUNCTION(curl_exec)
ch->uses++;
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
+ --ch->uses;
if (ch->handlers->write->type != PHP_CURL_BINARY) {
smart_str_0(&ch->handlers->write->buf);
}
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0);
}
-
+ --ch->uses;
RETURN_TRUE;
}
/* }}} */
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index b57907d15e..8f0345ff34 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -112,6 +112,8 @@ PHP_FUNCTION(curl_multi_remove_handle)
ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl);
zval_ptr_dtor(&z_ch);
+
+ --ch->uses;
RETURN_LONG((long) curl_multi_remove_handle(mh->multi, ch->cp));
}