- fix SEGV when there's an exception in HttpRequest::onFinish()
[m6w6/ext-http] / http_request_object.c
index 3fbfdbf61d198262d57ec2c58bec84a459be6e2b..319cb4f23bbf2db20f4e58e32f039d832884ff11 100644 (file)
@@ -721,6 +721,8 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this
                ret = FAILURE;
        }
        
+       http_request_set_progress_callback(obj->request, NULL);
+       
        if (!EG(exception) && zend_hash_exists(&Z_OBJCE_P(getThis())->function_table, "onfinish", sizeof("onfinish"))) {
                zval *param;
                
@@ -732,8 +734,6 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this
                zval_ptr_dtor(&param);
        }
        
-       http_request_set_progress_callback(obj->request, NULL);
-       
        return ret;
 }