simplify
authorMichael Wallner <mike@php.net>
Thu, 22 Jan 2015 14:51:39 +0000 (15:51 +0100)
committerMichael Wallner <mike@php.net>
Thu, 22 Jan 2015 14:51:39 +0000 (15:51 +0100)
php_http_message_body.c

index 500448936c7d2a9c3078a18df3e0ce9ce887122b..6c677bd6f4af5aafdb5a7a1b4ffb7cc494094554 100644 (file)
@@ -45,14 +45,13 @@ php_http_message_body_t *php_http_message_body_init(php_http_message_body_t **bo
        body->refcount = 1;
 
        if (stream) {
-               php_stream_auto_cleanup(stream);
                body->res = stream->res;
                ++GC_REFCOUNT(body->res);
        } else {
                stream = php_stream_temp_create(TEMP_STREAM_DEFAULT, 0xffff);
-               php_stream_auto_cleanup(stream);
                body->res = stream->res;
        }
+       php_stream_auto_cleanup(stream);
 
        if (body_ptr) {
                *body_ptr = body;