summaryrefslogtreecommitdiff
path: root/ext/iconv
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-09-21 13:37:30 +0000
committerAntony Dovgal <tony2001@php.net>2007-09-21 13:37:30 +0000
commit366c113156f7a04b8c577b32792b045dfb620b57 (patch)
tree90ed45765444031a89166ac0767fa1cf2a0d625c /ext/iconv
parent9ee4848c3f610d6a0962f79cb6cb271e292a5c54 (diff)
downloadphp-git-366c113156f7a04b8c577b32792b045dfb620b57.tar.gz
MFH: plug leak on error (coverity issue #407)
Diffstat (limited to 'ext/iconv')
-rw-r--r--ext/iconv/iconv.c3
1 files changed, 3 insertions, 0 deletions
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;