public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uml: fix memory leak in arch/um/os-Linux/mem.c
@ 2010-01-09 17:26 Alexander Beregalov
  2010-01-10  8:12 ` Américo Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Beregalov @ 2010-01-09 17:26 UTC (permalink / raw)
  To: jdike; +Cc: linux-kernel, Alexander Beregalov

Free tempname before exit.
Found by cppcheck.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 arch/um/os-Linux/mem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 93a11d7..f079ea0 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -175,7 +175,7 @@ static int __init make_tempfile(const char *template, char **out_tempname,
 
 	find_tempdir();
 	if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN))
-		return -1;
+		goto out;
 
 	if (template[0] != '/')
 		strcpy(tempname, tempdir);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-10  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-09 17:26 [PATCH] uml: fix memory leak in arch/um/os-Linux/mem.c Alexander Beregalov
2010-01-10  8:12 ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox