Skip to contentSkip to conversation

Fix leak in usermode linux

PATCH In review Eric Sesterhenn 2 participants 2 messages Oct 12, 2009 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix leak in usermode linux

hi,

this was spotted by cppcheck, if find_tempdir fails, we dont free tempname.

arch/um/os-Linux/mem.c renamed from arch/um/os-Linux/mem.c.orig +1 -1
@@ -175,7 +175,7 @@ static int __init make_tempfile(const ch
 
 	find_tempdir();
 	if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN))
-		return -1;
+		goto out;
 
 	if (template[0] != '/')
 		strcpy(tempname, tempdir);
Signature · 3 lines
LSE Leading Security Experts GmbH, Postfach 100121, 64201 Darmstadt
Unternehmenssitz: Weiterstadt, Amtsgericht Darmstadt: HRB8649
Geschäftsführer: Oliver Michel, Sven Walther
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Eric Sesterhenn

hi,

this was spotted by cppcheck, if find_tempdir fails, we dont free tempname.

Thanks!

Quoted 23 lines
arch/um/os-Linux/mem.c renamed from arch/um/os-Linux/mem.c.orig +1 -1
@@ -175,7 +175,7 @@ static int __init make_tempfile(const ch
 
 	find_tempdir();
 	if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN))
-		return -1;
+		goto out;
 
 	if (template[0] != '/')
 		strcpy(tempname, tempdir);
Signature · 10 lines
-- 
LSE Leading Security Experts GmbH, Postfach 100121, 64201 Darmstadt
Unternehmenssitz: Weiterstadt, Amtsgericht Darmstadt: HRB8649
Geschäftsführer: Oliver Michel, Sven Walther

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
Live like a child, think like the god.