negotiation test & fixes
[m6w6/ext-http] / php_http_negotiate.c
index aeb95211d2ed7a180de6407bbd647b6df40d48da..69c73934b02e9dbec810236bd0a5b99bed8895d4 100644 (file)
@@ -74,6 +74,11 @@ PHP_HTTP_API HashTable *php_http_negotiate(const char *value_str, size_t value_l
 
                                q = Z_DVAL_P(tmp);
                                zval_ptr_dtor(&tmp);
+
+                               if (!q) {
+                                       STR_FREE(key.str);
+                                       continue;
+                               }
                        } else {
                                q = 1.0 - ++i / 100.0;
                        }