- clean up
[m6w6/ext-http] / http_encoding_api.c
index 6c0d4157b2115ca6b917ffa443c2dc1c675e1186..bff322882ae8c25dbf4566b8f83c95db324bbaa3 100644 (file)
@@ -245,19 +245,13 @@ PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, ch
        STATUS status;
        z_stream Z;
        
-       *decoded = NULL;
-       *decoded_len = 0;
-       
-retry_inflate: 
        do {
                Z.zalloc = Z_NULL;
                Z.zfree  = Z_NULL;
                
                if (!max) {
-                       if (!*decoded) {
-                               *decoded_len = data_len * 2;
-                               *decoded = emalloc(*decoded_len + 1);
-                       }
+                       *decoded_len = data_len * 2;
+                       *decoded = emalloc(*decoded_len + 1);
                } else {
                        size_t new_len = *decoded_len << 2;
                        char *new_ptr = erealloc_recoverable(*decoded, new_len + 1);
@@ -270,6 +264,7 @@ retry_inflate:
                        }
                }
                
+retry_inflate:
                Z.next_in   = (Bytef *) data;
                Z.avail_in  = data_len;
                Z.next_out  = (Bytef *) *decoded;