From 604827b694aaf1ffcbd986043ba27642534f2ccf Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 25 Jun 2017 20:14:58 +0200 Subject: [PATCH] Fixed bug #73173 Patch by tloi at fortinet dot com. --- NEWS | 4 ++++ ext/wddx/tests/bug73173.phpt | 25 +++++++++++++++++++++++++ ext/wddx/wddx.c | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 ext/wddx/tests/bug73173.phpt diff --git a/NEWS b/NEWS index f215ab8dd7..b790a26e9f 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ PHP NEWS - SPL: . Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr) +- Wddx: + . Fixed bug #73173 (huge memleak when wddx_unserialize). + (tloi at fortinet dot com) + - zlib: . Fixed bug #73944 (dictionary option of inflate_init() does not work). (wapmorgan) diff --git a/ext/wddx/tests/bug73173.phpt b/ext/wddx/tests/bug73173.phpt new file mode 100644 index 0000000000..00fe56e4b0 --- /dev/null +++ b/ext/wddx/tests/bug73173.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #73173: huge memleak when wddx_unserialize +--SKIPIF-- + +--FILE-- + + + + + +XML; +var_dump(wddx_deserialize($xml)); + +?> +--EXPECT-- +NULL diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 4040ed61c6..25d7deae17 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -241,6 +241,9 @@ static int wddx_stack_destroy(wddx_stack *stack) } efree(stack->elements); } + if (stack->varname) { + efree(stack->varname); + } return SUCCESS; } /* }}} */ -- 2.40.0