fix possible bus error on shutdown when using events
authorMichael Wallner <mike@php.net>
Wed, 13 Aug 2014 12:18:37 +0000 (14:18 +0200)
committerMichael Wallner <mike@php.net>
Wed, 13 Aug 2014 12:18:37 +0000 (14:18 +0200)
php_http_client_curl.c

index b688497..37f255b 100644 (file)
@@ -1736,6 +1736,9 @@ static void php_http_client_curl_dtor(php_http_client_t *h)
 
 #if PHP_HTTP_HAVE_EVENT
        if (curl->timeout) {
+               if (event_initialized(curl->timeout) && event_pending(curl->timeout, EV_TIMEOUT, NULL)) {
+                       event_del(curl->timeout);
+               }
                efree(curl->timeout);
                curl->timeout = NULL;
        }