Commit e6deda2e authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf bench epoll: Fix missing frees/puts on the exit path

Issues detected by leak sanitizer.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230611233610.953456-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 0f0d1354
...@@ -421,6 +421,11 @@ int bench_epoll_ctl(int argc, const char **argv) ...@@ -421,6 +421,11 @@ int bench_epoll_ctl(int argc, const char **argv)
print_summary(); print_summary();
close(epollfd); close(epollfd);
perf_cpu_map__put(cpu);
for (i = 0; i < nthreads; i++)
free(worker[i].fdmap);
free(worker);
return ret; return ret;
errmem: errmem:
err(EXIT_FAILURE, "calloc"); err(EXIT_FAILURE, "calloc");
......
...@@ -549,6 +549,11 @@ int bench_epoll_wait(int argc, const char **argv) ...@@ -549,6 +549,11 @@ int bench_epoll_wait(int argc, const char **argv)
print_summary(); print_summary();
close(epollfd); close(epollfd);
perf_cpu_map__put(cpu);
for (i = 0; i < nthreads; i++)
free(worker[i].fdmap);
free(worker);
return ret; return ret;
errmem: errmem:
err(EXIT_FAILURE, "calloc"); err(EXIT_FAILURE, "calloc");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment