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 de1f98f126fb36556b772d57aab1c3d1e9ac8aee..d61644ce3de734b2c7bda3598f5d91bf643b5e7f 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 535c541db15a5767e89a5d622307dbc5c73ed41c..ab5b7ba87765fa7fb1df2010696c1dcb2132c09c 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);
                }