Skip to content

Commit 5e4e376

Browse files
author
Sterling Hughes
committed
If the transfer fails, still free the buffer if it exists.
1 parent fa684c5 commit 5e4e376

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/curl/curl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ PHP_FUNCTION(curl_exec)
825825

826826
error = curl_easy_perform(ch->cp);
827827
if (error != CURLE_OK) {
828+
if (ch->handlers->write->buf)
829+
smart_str_free(&ch->handlers->write->buf);
828830
SAVE_CURL_ERROR(ch, error);
829831
RETURN_FALSE;
830832
}

0 commit comments

Comments
 (0)