From: Jim Meyering <[email protected]>
* lib/cfg.c (corosync_cfg_ring_status_get): Avoid useless if-before-free
and change syntax to avoid triggering false-positive failure of
the "make syntax-check" sc_cast_of_argument_to_free rule.
---
lib/cfg.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/cfg.c b/lib/cfg.c
index 4cd0c92..3965002 100644
--- a/lib/cfg.c
+++ b/lib/cfg.c
@@ -324,12 +324,8 @@ corosync_cfg_ring_status_get (
error_free_contents:
for (i = 0; i < res_lib_cfg_ringstatusget.interface_count; i++) {
- if ((*(interface_names))[i]) {
- free ((*(interface_names))[i]);
- }
- if ((*(status))[i]) {
- free ((*(status))[i]);
- }
+ free (*interface_names + i);
+ free (*status + i);
}
free (*status);
--
1.6.3.1.135.g540c.dirty
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais