* fix memleak
authorMichael Wallner <mike@php.net>
Fri, 18 Mar 2005 13:05:23 +0000 (13:05 +0000)
committerMichael Wallner <mike@php.net>
Fri, 18 Mar 2005 13:05:23 +0000 (13:05 +0000)
http_api.c

index 20dc30da8d2629770946254ce5282c62562d66b1..2b3e33c7d57fbc400aaf41d260d3111ecbbeb2c7 100644 (file)
@@ -1093,9 +1093,12 @@ PHP_HTTP_API char *_http_negotiate_q(const char *entry, const HashTable *support
        
        FOREACH_HASH_KEY(Z_ARRVAL(zentries), key, idx) {
                if (key) {
-                       return estrdup(key);
+                       key = estrdup(key);
+                       zval_dtor(&zentries);
+                       return key;
                }
        }
+       zval_dtor(&zentries);
        
        return estrdup(def);
 }