From 3e5dc58f35e6c6ce90e5c7b917659a2b969169d6 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Sat, 15 Jan 2000 23:34:51 +0000 Subject: [PATCH] (wddx_stack_destroy) Properly free the dangling varname. (php_wddx_deserialize_ex) There should be only 1 value on the stack after parser is done. --- ext/wddx/wddx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 0b500c6bb4..261ed3fce4 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -187,6 +187,8 @@ static int wddx_stack_destroy(wddx_stack *stack) zval_dtor(((st_entry *)stack->elements[i])->data); efree(((st_entry *)stack->elements[i])->data); } + if (((st_entry *)stack->elements[i])->varname) + efree(((st_entry *)stack->elements[i])->varname); efree(stack->elements[i]); } efree(stack->elements); @@ -727,7 +729,7 @@ void php_wddx_deserialize_ex(char *value, int vallen, zval *return_value) XML_ParserFree(parser); - if (!wddx_stack_is_empty(&stack)) { + if (stack.top == 1) { wddx_stack_top(&stack, (void**)&ent); *return_value = *(ent->data); zval_copy_ctor(return_value); -- 2.50.1