From 34cf8e1c6e5e4c90243c3e204d5c8f22b19e3469 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 21 Sep 2012 16:42:13 +0700 Subject: [PATCH] Fix double free --- ext/twig/twig.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) 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; } /* -- 1.7.2.5