Skip to content

Commit 9cc896f

Browse files
Fix curl memory leak (#5947)
1 parent db0fe1d commit 9cc896f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

thirdparty/php/curl/interface.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,10 @@ static void swoole_curl_free_obj(zend_object *object) {
28712871
swoole::curl::destroy_handle(ch->cp);
28722872
}
28732873

2874+
if (ch->cp) {
2875+
curl_easy_cleanup(ch->cp);
2876+
}
2877+
28742878
smart_str_free(&ch->handlers.write->buf);
28752879
zval_ptr_dtor(&ch->handlers.write->func_name);
28762880
zval_ptr_dtor(&ch->handlers.read->func_name);

0 commit comments

Comments
 (0)