From 7086aae378d85dd84f5ca3dc8c374bb4cabe29b0 Mon Sep 17 00:00:00 2001 From: duerst Date: Tue, 27 Nov 2018 21:00:06 +0000 Subject: [PATCH] make sure all nodes are correctly freed in create_property_node() We make sure that the newly created tree and all remaining nodes passed in in the node_array are freed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regparse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regparse.c b/regparse.c index c70faaa34e..69f700986c 100644 --- a/regparse.c +++ b/regparse.c @@ -5770,6 +5770,10 @@ create_sequence_node(Node **np, Node **node_array) while (--i >= 0) { *np = node_new_list(node_array[i], tmp); if (IS_NULL(*np)) { + while (i >= 0) { + onig_node_free(node_array[i]); + node_array[i--] = NULL_NODE; + } onig_node_free(tmp); return ONIGERR_MEMORY; }