acl: add missing C++ guards
[dpdk.git] / lib / graph / graph_stats.c
index 30e295d..65e12d4 100644 (file)
@@ -119,8 +119,8 @@ stats_mem_init(struct cluster *cluster,
        cluster_node_size = RTE_ALIGN(cluster_node_size, RTE_CACHE_LINE_SIZE);
 
        stats = realloc(NULL, sz);
-       memset(stats, 0, sz);
        if (stats) {
+               memset(stats, 0, sz);
                stats->fn = fn;
                stats->cluster_node_size = cluster_node_size;
                stats->max_nodes = 0;
@@ -233,8 +233,7 @@ free:
 static void
 cluster_fini(struct cluster *cluster)
 {
-       if (cluster->graphs)
-               free(cluster->graphs);
+       free(cluster->graphs);
 }
 
 static int