From: Antony Dovgal Date: Thu, 1 Feb 2007 13:45:25 +0000 (+0000) Subject: fix leaks on error X-Git-Tag: php-5.2.1~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82f70c9493257e5ec86ea285b3a38ae334375d80;p=php fix leaks on error --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 34609bcdb1..70d26264e8 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1881,6 +1881,8 @@ PHP_FUNCTION(strripos) if (offset >= 0) { if (offset > haystack_len) { + efree(needle_dup); + efree(haystack_dup); php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string"); RETURN_FALSE; } @@ -1888,6 +1890,8 @@ PHP_FUNCTION(strripos) e = haystack_dup + haystack_len - needle_len; } else { if (-offset > haystack_len) { + efree(needle_dup); + efree(haystack_dup); php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string"); RETURN_FALSE; }