diff --git a/backport-Fix-memory-leak.patch b/backport-Fix-memory-leak.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9f6a604ab1a8c26df0a9e83dd96f38ba7f5962d --- /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 59e971843026f07abc8e180bcf797086767f1f6f..e8f50c29c462a006d8803bddf196abdbb9835411 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