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

index 9e728115100b9a54991b0ce9c0ddd78d2525f6db..331f34b2ec835133b1a346babc30dcea4bbe37ee 100644 (file)
@@ -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;