[PATCH v3 3/4] perf tools: Use zfree() instead of free() and assigning NULL to the pointer
From: Taeung Song
Date: Wed Feb 01 2017 - 07:34:29 EST
Signed-off-by: Taeung Song <treeze.taeung@xxxxxxxxx>
---
tools/perf/util/parse-events.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 0c3b81a..316f054 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -254,8 +254,7 @@ struct tracepoint_path *tracepoint_name_to_path(const char *name)
if (path->system == NULL || path->name == NULL) {
zfree(&path->system);
zfree(&path->name);
- free(path);
- path = NULL;
+ zfree(&path);
}
return path;
@@ -1482,8 +1481,7 @@ static void perf_pmu__parse_cleanup(void)
p = perf_pmu_events_list + i;
free(p->symbol);
}
- free(perf_pmu_events_list);
- perf_pmu_events_list = NULL;
+ zfree(&perf_pmu_events_list);
perf_pmu_events_list_num = 0;
}
}
--
2.7.4