commit 1d14bc6: [Fix] Libucl: avoid memory leak on objects merging

Vsevolod Stakhov vsevolod at rspamd.com
Sat Sep 24 19:07:07 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-09-24 14:38:48 +0100
URL: https://github.com/rspamd/rspamd/commit/1d14bc6468d97834806668b437c26f20630fdc7c

[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);


More information about the Commits mailing list