From 366c113156f7a04b8c577b32792b045dfb620b57 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 21 Sep 2007 13:37:30 +0000 Subject: [PATCH] MFH: 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 2aca0b5cc0..2da0cd7998 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -851,6 +851,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