fix leaks
authorMichael Wallner <mike@php.net>
Tue, 16 Jun 2015 12:14:25 +0000 (14:14 +0200)
committerMichael Wallner <mike@php.net>
Tue, 16 Jun 2015 12:14:25 +0000 (14:14 +0200)
php_http_message.c
php_http_message_body.c

index de1f98f..d61644c 100644 (file)
@@ -843,10 +843,16 @@ void php_http_message_object_free(zend_object *object)
                o->message = NULL;
        }
        if (o->parent) {
+               if (GC_REFCOUNT(&o->parent->zo) == 1) {
+                       zend_objects_store_del(&o->parent->zo);
+               }
                zend_objects_store_del(&o->parent->zo);
                o->parent = NULL;
        }
        if (o->body) {
+               if (GC_REFCOUNT(&o->body->zo) == 1) {
+                       zend_objects_store_del(&o->body->zo);
+               }
                zend_objects_store_del(&o->body->zo);
                o->body = NULL;
        }
index 535c541..ab5b7ba 100644 (file)
@@ -93,7 +93,7 @@ void php_http_message_body_free(php_http_message_body_t **body_ptr)
                php_http_message_body_t *body = *body_ptr;
 
                if (!--body->refcount) {
-                       //zend_list_close(body->res);
+                       zend_list_delete(body->res);
                        PTR_FREE(body->boundary);
                        efree(body);
                }