From: Vsevolod Stakhov Date: Sat, 24 Sep 2022 13:38:48 +0000 (+0100) Subject: [Fix] Libucl: avoid memory leak on objects merging X-Git-Tag: 3.3~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d14bc6468d97834806668b437c26f20630fdc7c;p=thirdparty%2Frspamd.git [Fix] Libucl: avoid memory leak on objects merging --- diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c index 13544af28d..3f2483c10f 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);