sbd/0001-Refactor-sbd-md-alloc-de-alloc-reverse-order-in-slot.patch
Klaus Wenninger 5e9ffffc07 * Mon Jan 31 2022 Klaus Wenninger <kwenning@redhat.com> - 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.
2022-02-01 17:19:11 +01:00

32 lines
744 B
Diff

From 2e0890980c6e8c49f681b855c4cfe9443529d7a2 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
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