Skip to contentSkip to conversation

tools/perf/tests: Fix memory leak in dso-data.c

PATCH In review Felipe Pena 3 participants 3 messages Oct 10, 2013 – Oct 15, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/perf/tests: Fix memory leak in dso-data.c

Fix for a memory leak on test_file() function in dso-data.c

---
 tools/perf/tests/dso-data.c |    1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/dso-data.c +1 -0
index dffe055..9cc81a3 100644
@@ -35,6 +35,7 @@ static char *test_file(int size)
 	if (size != write(fd, buf, size))
 		templ = NULL;
 
+	free(buf);
 	close(fd);
 	return templ;
 }

--
1.7.10.4

Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Felipe Pena

Fix for a memory leak on test_file() function in dso-data.c

oops, thanks ;-)

Quoted 21 lines
---
 tools/perf/tests/dso-data.c |    1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/dso-data.c +1 -1
index dffe055..9cc81a3 100644
@@ -35,6 +35,7 @@ static char *test_file(int size)
 	if (size != write(fd, buf, size))
 		templ = NULL;
 
+	free(buf);
 	close(fd);
 	return templ;
 }
--

1.7.10.4

#2 lore raw

[tip:perf/core] perf tests: Fix memory leak in dso-data.c

In reply to Felipe Pena
perf tests: Fix memory leak in dso-data.c
Commit-ID:  1df9297c8535a5bb2b776381e63d8334f87d4abe
Gitweb:     http://git.kernel.org/tip/1df9297c8535a5bb2b776381e63d8334f87d4abe
Author:     Felipe Pena <[email protected]>
AuthorDate: Wed, 9 Oct 2013 23:00:38 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 14 Oct 2013 10:28:54 -0300

perf tests: Fix memory leak in dso-data.c

Fix for a memory leak on test_file() function in dso-data.c.

---
 tools/perf/tests/dso-data.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/dso-data.c +1 -0
index dffe055..9cc81a3 100644
@@ -35,6 +35,7 @@ static char *test_file(int size)
 	if (size != write(fd, buf, size))
 		templ = NULL;
 
+	free(buf);
 	close(fd);
 	return templ;
 }