From: Antony Dovgal Date: Fri, 21 Sep 2007 13:41:02 +0000 (+0000) Subject: plug leak on error (coverity issue #407) X-Git-Tag: RELEASE_2_0_0a1~1772 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b3e9fe52855a093192a831b5349d352c86536f1;p=php plug leak on error (coverity issue #407) --- diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 9e72811510..331f34b2ec 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -913,6 +913,9 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval, cd = iconv_open(GENERIC_SUPERSET_NAME, enc); if (cd == (iconv_t)(-1)) { + if (ndl_buf != NULL) { + efree(ndl_buf); + } #if ICONV_SUPPORTS_ERRNO if (errno == EINVAL) { return PHP_ICONV_ERR_WRONG_CHARSET;