summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/dso-data.c
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2013-10-10 04:00:38 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-14 15:28:54 +0200
commit1df9297c8535a5bb2b776381e63d8334f87d4abe (patch)
treee4b87ae3f51b9cef643a12e90c55021b9887c09d /tools/perf/tests/dso-data.c
parentperf tools: Fix old GCC build error in 'get_srcline' (diff)
downloadlinux-1df9297c8535a5bb2b776381e63d8334f87d4abe.tar.xz
linux-1df9297c8535a5bb2b776381e63d8334f87d4abe.zip
perf tests: Fix memory leak in dso-data.c
Fix for a memory leak on test_file() function in dso-data.c. Signed-off-by: Felipe Pena <felipensp@gmail.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1381370438-4209-1-git-send-email-felipensp@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/dso-data.c')
-rw-r--r--tools/perf/tests/dso-data.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index dffe0551acaa..9cc81a3eb9b4 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -35,6 +35,7 @@ static char *test_file(int size)
if (size != write(fd, buf, size))
templ = NULL;
+ free(buf);
close(fd);
return templ;
}