]> granicus.if.org Git - php/commitdiff
if needle is empty free allocated memory
authorSterling Hughes <sterling@php.net>
Thu, 26 Dec 2002 20:52:42 +0000 (20:52 +0000)
committerSterling Hughes <sterling@php.net>
Thu, 26 Dec 2002 20:52:42 +0000 (20:52 +0000)
ext/standard/string.c

index f450e2a720b1318caa6c58042af6d99dd226fce3..d5defdc253a8af9dfefc368b20a115dc162deec5 100644 (file)
@@ -1352,6 +1352,9 @@ PHP_FUNCTION(stristr)
        if (Z_TYPE_PP(needle) == IS_STRING) {
                if (!Z_STRLEN_PP(needle)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter.");
+                       efree(haystack_orig);
+                       zval_ptr_dtor(haystack);
+                       zval_ptr_dtor(needle);
                        RETURN_FALSE;
                }