]> granicus.if.org Git - php/commitdiff
MFH: plug leak on error (coverity issue #407)
authorAntony Dovgal <tony2001@php.net>
Fri, 21 Sep 2007 13:37:30 +0000 (13:37 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 21 Sep 2007 13:37:30 +0000 (13:37 +0000)
ext/iconv/iconv.c

index 2aca0b5cc0d32ab26538b0a94a3ca969825c0657..2da0cd7998b16cf9637f1a4410a16e67dda0e300 100644 (file)
@@ -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;