X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_http_encoding.c;h=b5094eea1ac91f16fceeb0cab955641fa9ea790f;hb=e595d8abe5b5a93e30bd7ffba6c13fad107ce08c;hp=286f2b5751eac1b703c44b0fa2063716d431582f;hpb=bdd6edb59194cda9e5fcb393c48ab4230fceb32a;p=m6w6%2Fext-http diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c index 286f2b5..b5094ee 100644 --- a/src/php_http_encoding.c +++ b/src/php_http_encoding.c @@ -64,7 +64,7 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c /* reached the end */ if (!chunk_len) { /* move over '0' chunked encoding terminator and any new lines */ - do { + while(1) { switch (*e_ptr) { case '0': case '\r': @@ -72,7 +72,8 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c ++e_ptr; continue; } - } while (0); + break; + } break; } @@ -222,7 +223,7 @@ retry_raw_inflate: } inflateEnd(&Z); - if (decoded_len && *decoded) { + if (*decoded_len && *decoded) { efree(*decoded); } } @@ -264,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)); @@ -281,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;