perf tests: Fix memory leak in dso-data.c
authorFelipe Pena <[email protected]>
Thu, 10 Oct 2013 02:00:38 +0000 (23:00 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 14 Oct 2013 13:28:54 +0000 (10:28 -0300)
Fix for a memory leak on test_file() function in dso-data.c.

Signed-off-by: Felipe Pena <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/tests/dso-data.c

index dffe0551acaa717add54e96bfb864c8fbf6cf2d6..9cc81a3eb9b456e6d2693bce799fedb0caba9862 100644 (file)
@@ -35,6 +35,7 @@ static char *test_file(int size)
        if (size != write(fd, buf, size))
                templ = NULL;
 
+       free(buf);
        close(fd);
        return templ;
 }