diff options
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browser.c | 6 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 6 | ||||
-rw-r--r-- | tools/perf/ui/gtk/util.c | 3 |
3 files changed, 5 insertions, 10 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 94223d404f43..d11541d4d7d7 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -256,8 +256,7 @@ int ui_browser__show(struct ui_browser *browser, const char *title, __ui_browser__show_title(browser, title); browser->title = title; - free(browser->helpline); - browser->helpline = NULL; + zfree(&browser->helpline); va_start(ap, helpline); err = vasprintf(&browser->helpline, helpline, ap); @@ -272,8 +271,7 @@ void ui_browser__hide(struct ui_browser *browser) { pthread_mutex_lock(&ui__lock); ui_helpline__pop(); - free(browser->helpline); - browser->helpline = NULL; + zfree(&browser->helpline); pthread_mutex_unlock(&ui__lock); } diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 0d9dd99507ee..022d1731b801 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -1267,10 +1267,8 @@ static inline void free_popup_options(char **options, int n) { int i; - for (i = 0; i < n; ++i) { - free(options[i]); - options[i] = NULL; - } + for (i = 0; i < n; ++i) + zfree(&options[i]); } /* Check whether the browser is for 'top' or 'report' */ diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c index 696c1fbe4248..52e7fc48af9f 100644 --- a/tools/perf/ui/gtk/util.c +++ b/tools/perf/ui/gtk/util.c @@ -23,8 +23,7 @@ int perf_gtk__deactivate_context(struct perf_gtk_context **ctx) if (!perf_gtk__is_active_context(*ctx)) return -1; - free(*ctx); - *ctx = NULL; + zfree(ctx); return 0; } |