We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 404b4c8 commit a182f0fCopy full SHA for a182f0f
1 file changed
ext/curl/multi.c
@@ -565,6 +565,18 @@ static void curl_multi_free_obj(zend_object *object)
565
}
566
567
568
+#if LIBCURL_VERSION_NUM < 0x071e00 /* 7.30.0 */
569
+ /* In 7.29.0 curl_multi_cleanup segfaults if there no handles have been
570
+ * added. To avoid this, just add and then remove a dummy handle. */
571
+ CURL *tmp_cp = curl_easy_init();
572
+ if (tmp_cp) {
573
+ if (curl_multi_add_handle(mh->multi, tmp_cp) == CURLM_OK) {
574
+ curl_multi_remove_handle(mh->multi, tmp_cp);
575
+ }
576
+ curl_easy_cleanup(tmp_cp);
577
578
+#endif
579
+
580
curl_multi_cleanup(mh->multi);
581
zend_llist_clean(&mh->easyh);
582
if (mh->handlers.server_push) {
0 commit comments