1. add index for patchs; 2. add cmake options for test and binary; Signed-off-by: haozi007 <liuhao27@huawei.com>
28 lines
753 B
Diff
28 lines
753 B
Diff
From d6d0aeb5f6432763929d4096344ec2caf6d13d89 Mon Sep 17 00:00:00 2001
|
|
From: haozi007 <liuhao27@huawei.com>
|
|
Date: Sat, 28 May 2022 10:06:46 +0100
|
|
Subject: [PATCH] fix memory leak of ctx root
|
|
|
|
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
|
---
|
|
src/yajl_tree.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/src/yajl_tree.c b/src/yajl_tree.c
|
|
index 4b3cf2b..dc55f74 100644
|
|
--- a/src/yajl_tree.c
|
|
+++ b/src/yajl_tree.c
|
|
@@ -449,6 +449,9 @@ yajl_val yajl_tree_parse (const char *input,
|
|
yajl_tree_free(v);
|
|
}
|
|
yajl_free (handle);
|
|
+ //If the requested memory is not released in time, it will cause memory leakage
|
|
+ if(ctx.root)
|
|
+ yajl_tree_free(ctx.root);
|
|
return NULL;
|
|
}
|
|
|
|
--
|
|
2.20.1
|
|
|