From: Alexander Beregalov <a.beregalov@gmail.com>
To: jdike@addtoit.com
Cc: linux-kernel@vger.kernel.org,
Alexander Beregalov <a.beregalov@gmail.com>
Subject: [PATCH] uml: fix memory leak in arch/um/os-Linux/mem.c
Date: Sat, 9 Jan 2010 20:26:24 +0300 [thread overview]
Message-ID: <1263057984-12487-1-git-send-email-a.beregalov@gmail.com> (raw)
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
next reply other threads:[~2010-01-09 17:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-09 17:26 Alexander Beregalov [this message]
2010-01-10 8:12 ` Américo Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263057984-12487-1-git-send-email-a.beregalov@gmail.com \
--to=a.beregalov@gmail.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®