From 5e9ffffc0705f545f7a5930185290d48fd68a164 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Tue, 1 Feb 2022 17:19:11 +0100 Subject: [PATCH] * Mon Jan 31 2022 Klaus Wenninger - 1.5.1-2 - Having de-allocation in the reverse order compared to allocation seems to make gcc-12 static analysis of dynamic-memory-management happy. --- ...alloc-de-alloc-reverse-order-in-slot.patch | 31 +++++++++++++++++++ sbd.spec | 10 ++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch diff --git a/0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch b/0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch new file mode 100644 index 0000000..350c02c --- /dev/null +++ b/0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch @@ -0,0 +1,31 @@ +From 2e0890980c6e8c49f681b855c4cfe9443529d7a2 Mon Sep 17 00:00:00 2001 +From: Klaus Wenninger +Date: Sun, 30 Jan 2022 17:25:18 +0100 +Subject: [PATCH] Refactor: sbd-md: alloc/de-alloc reverse order in slot_list + +Having de-allocation in the reverse order compared to +allocation seems to make gcc-12 static analysis of +dynamic-memory-management happy. +--- + src/sbd-md.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sbd-md.c b/src/sbd-md.c +index 47cbe8c..7a37522 100644 +--- a/src/sbd-md.c ++++ b/src/sbd-md.c +@@ -593,9 +593,9 @@ slot_list(struct sbd_context *st) + } + } + +-out: free(s_node); ++out: free(s_mbox); ++ free(s_node); + free(s_header); +- free(s_mbox); + return rc; + } + +-- +1.8.3.1 + diff --git a/sbd.spec b/sbd.spec index 3c70cc1..9ea977f 100644 --- a/sbd.spec +++ b/sbd.spec @@ -19,7 +19,7 @@ %global shortcommit %(echo %{longcommit}|cut -c1-8) %global modified %(echo %{longcommit}-|cut -f2 -d-) %global github_owner Clusterlabs -%global buildnum 1 +%global buildnum 2 %ifarch s390x s390 # minimum timeout on LPAR diag288 watchdog is 15s @@ -49,9 +49,10 @@ Name: sbd Summary: Storage-based death License: GPLv2+ Version: 1.5.1 -Release: %{buildnum}%{?dist}.1 +Release: %{buildnum}%{?dist} Url: https://github.com/%{github_owner}/%{name} Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz +Patch0: 0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libuuid-devel @@ -176,6 +177,11 @@ fi %{_libdir}/libsbdtestbed* %changelog +* Mon Jan 31 2022 Klaus Wenninger - 1.5.1-2 +- Having de-allocation in the reverse order compared to + allocation seems to make gcc-12 static analysis of + dynamic-memory-management happy. + * Sat Jan 22 2022 Fedora Release Engineering - 1.5.1-1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild