lkml.org 
[lkml]   [2010]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] uml: fix memory leak in arch/um/os-Linux/mem.c
Date
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


\
 
 \ /
  Last update: 2010-01-09 18:29    [W:0.717 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site