From 5a8aa6f0cbf856f9cf4b48a493fc35fb897c550b Mon Sep 17 00:00:00 2001 From: liuzhilin Date: Fri, 18 Jul 2025 09:53:24 +0800 Subject: [PATCH] backport Fix memory leak --- backport-Fix-memory-leak.patch | 31 +++++++++++++++++++++++++++++++ jose.spec | 10 +++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-memory-leak.patch diff --git a/backport-Fix-memory-leak.patch b/backport-Fix-memory-leak.patch new file mode 100644 index 0000000..c9f6a60 --- /dev/null +++ b/backport-Fix-memory-leak.patch @@ -0,0 +1,31 @@ +From 874c6655aec1da9ecaad1583d78d4cde0bf2f8ce Mon Sep 17 00:00:00 2001 +From: Jason Power +Date: Thu, 20 Feb 2025 16:27:24 +0000 +Subject: [PATCH] Fix memory leak + +--- + lib/misc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/misc.c b/lib/misc.c +index 1015ce4..f9cacd9 100644 +--- a/lib/misc.c ++++ b/lib/misc.c +@@ -47,7 +47,7 @@ zero(void *mem, size_t len) + bool + handle_zip_enc(json_t *json, const void *in, size_t len, void **data, size_t *datalen) + { +- json_t *prt = NULL; ++ json_auto_t *prt = NULL; + char *z = NULL; + const jose_hook_alg_t *a = NULL; + jose_io_auto_t *zip = NULL; +@@ -85,7 +85,7 @@ handle_zip_enc(json_t *json, const void *in, size_t len, void **data, size_t *da + bool + zip_in_protected_header(json_t *json) + { +- json_t *prt = NULL; ++ json_auto_t *prt = NULL; + char *z = NULL; + + prt = json_object_get(json, "protected"); diff --git a/jose.spec b/jose.spec index 59e9718..e8f50c2 100644 --- a/jose.spec +++ b/jose.spec @@ -1,11 +1,13 @@ Name: jose Version: 14 -Release: 1 +Release: 2 Summary: José is a command line utility for performing various tasks on JSON objects License: ASL 2.0 URL: https://github.com/latchset/%{name} Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz +Patch0: backport-Fix-memory-leak.patch + BuildRequires: pkgconfig, gcc, openssl-devel, zlib-devel, meson, ninja-build, asciidoc BuildRequires: jansson-devel >= 2.10 @@ -81,6 +83,12 @@ rm -rf %{buildroot}/%{_libdir}/lib%{name}.la %changelog +* Fri Jul 18 2025 liuzhilin - 14-2 +- Type:backport bugfix +- ID:NA +- SUG:NA +- DESC:backport fix memory leak + * Wed Jul 24 2024 dillon chen - 14-1 - Type:enhancement - ID:NA -- Gitee