avoid crash when TWIG_GET_ARRAY_ELEMENT returns NULL

fixes #807
This commit is contained in:
Arnaud Le Blanc
2012-08-20 20:28:22 +02:00
parent 3694d4b2bf
commit 3ca6654617
+3
View File
@@ -713,6 +713,9 @@ PHP_FUNCTION(twig_template_get_attributes)
}
ret = TWIG_GET_ARRAY_ELEMENT(object, item, item_len TSRMLS_CC);
if (!ret) {
ret = &EG(uninitialized_zval);
}
RETVAL_ZVAL(ret, 1, 0);
if (free_ret) {
zval_ptr_dtor(&ret);