From: Charles Date: Fri, 21 Sep 2012 09:42:13 +0000 (+0700) Subject: Fix double free X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=34cf8e1c6e5e4c90243c3e204d5c8f22b19e3469;p=web%2Fkonrad%2Ftwig.git Fix double free --- diff --git a/ext/twig/twig.c b/ext/twig/twig.c index a1b9d0e..4476bb7 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -927,11 +927,10 @@ PHP_FUNCTION(twig_template_get_attributes) return; } - efree(tmp_method_name_get); - efree(tmp_method_name_is); - efree(lcItem); - if (isDefinedTest) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); RETURN_TRUE; } /* @@ -943,6 +942,9 @@ PHP_FUNCTION(twig_template_get_attributes) TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "sandbox" TSRMLS_CC), "checkMethodAllowed", object, &zitem TSRMLS_CC); } if (EG(exception)) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); return; } /*