From: Michael Wallner Date: Wed, 14 Sep 2016 10:55:43 +0000 (+0200) Subject: coverity fix X-Git-Tag: RELEASE_2_6_0_RC1~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f8b17453289061baee75586df671c62e9cd120e1;p=m6w6%2Fext-http coverity fix --- diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c index 8c29216..b5094ee 100644 --- a/src/php_http_encoding.c +++ b/src/php_http_encoding.c @@ -265,10 +265,9 @@ php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stre TSRMLS_FETCH_FROM_CTX(from->ts); if (from->ops->copy) { - int freeme; php_http_encoding_stream_t *ns; - if ((freeme = !to)) { + if (!to) { to = pemalloc(sizeof(*to), (from->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); } memset(to, 0, sizeof(*to)); @@ -282,10 +281,6 @@ php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stre } else { return to; } - - if (freeme) { - pefree(to, (to->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); - } } return NULL;