From 1d14bc6468d97834806668b437c26f20630fdc7c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 24 Sep 2022 14:38:48 +0100 Subject: [PATCH] [Fix] Libucl: avoid memory leak on objects merging --- contrib/libucl/ucl_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c index 13544af28..3f2483c10 100644 --- a/contrib/libucl/ucl_util.c +++ b/contrib/libucl/ucl_util.c @@ -2604,6 +2604,7 @@ ucl_object_merge (ucl_object_t *top, ucl_object_t *elt, bool copy) if (!ucl_object_merge (found, cp, copy)) { return false; } + ucl_object_unref (cp); } else { ucl_hash_replace (top->value.ov, found, cp); @@ -2635,6 +2636,7 @@ ucl_object_merge (ucl_object_t *top, ucl_object_t *elt, bool copy) if (!ucl_object_merge (found, cp, copy)) { return false; } + ucl_object_unref (cp); } else { ucl_hash_replace (top->value.ov, found, cp); -- 2.39.5