diff --git a/backport-fix-memory-leaks.patch b/backport-fix-memory-leaks.patch new file mode 100644 index 0000000000000000000000000000000000000000..c5817a1ac33369f9773d588fa7808cbf7b5979b6 --- /dev/null +++ b/backport-fix-memory-leaks.patch @@ -0,0 +1,26 @@ +From 23a122eddaa28165a6c219000adcc31ff9a8a698 Mon Sep 17 00:00:00 2001 +From: "zhang.jiujiu" <282627424@qq.com> +Date: Tue, 7 Dec 2021 22:37:02 +0800 +Subject: [PATCH] fix memory leaks + +--- + src/yajl_tree.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/yajl_tree.c b/src/yajl_tree.c +index b9e6604..0e7bde9 100644 +--- a/src/yajl_tree.c ++++ b/src/yajl_tree.c +@@ -456,6 +456,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; + } + +-- +1.8.3.1 + diff --git a/yajl.spec b/yajl.spec index 5fef5e0855b2bd16b1927290fc32a8168b49da47..5f1691c23de4564203ad6b36ea467eee259caff9 100644 --- a/yajl.spec +++ b/yajl.spec @@ -1,6 +1,6 @@ Name: yajl Version: 2.1.0 -Release: 13 +Release: 14 Summary: Yet Another JSON Library License: ISC URL: http://lloyd.github.com/yajl/ @@ -11,6 +11,7 @@ Patch2: yajl-2.1.0-pkgconfig-includedir.patch Patch3: yajl-2.1.0-test-location.patch Patch4: yajl-2.1.0-dynlink-binaries.patch Patch5: yajl-2.1.0-fix-memory-leak.patch +Patch6: backport-fix-memory-leaks.patch BuildRequires: cmake gcc @@ -67,6 +68,9 @@ cd ../api %{_libdir}/libyajl_s.a %changelog +* Sat Feb 12 2022 fuanan - 2.1.0-14 +- fix memory leaks in yajl_tree_parse + * Tue Jun 8 2021 panxiaohe - 2.1.0-13 - add gcc to BuildRequires