[PATCH v2 79/83] graph: remove unnecessary NULL checks
Stephen Hemminger
stephen at networkplumber.org
Mon Jan 24 18:47:15 CET 2022
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/graph/graph_stats.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c
index aa70929dc32e..65e12d46a313 100644
--- a/lib/graph/graph_stats.c
+++ b/lib/graph/graph_stats.c
@@ -233,8 +233,7 @@ cluster_add(struct cluster *cluster, struct graph *graph)
static void
cluster_fini(struct cluster *cluster)
{
- if (cluster->graphs)
- free(cluster->graphs);
+ free(cluster->graphs);
}
static int
--
2.30.2
More information about the dev
mailing list