From 6b3e9fe52855a093192a831b5349d352c86536f1 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 21 Sep 2007 13:41:02 +0000 Subject: [PATCH] plug leak on error (coverity issue #407) --- ext/iconv/iconv.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.50.1