lkml.org 
[lkml]   [2006]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] tpm: fix memory leak
From
Date
The eventname was kmalloc'd and not freed in the *_show functions.

This bug was found by Coverity.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
drivers/char/tpm/tpm_bios.c | 2 ++
1 files changed, 2 insertions(+)

--- linux-2.6.17-rc1/drivers/char/tpm/tpm_bios.c 2006-04-18 15:14:45.626390250 -0500
+++ linux-2.6.17-rc1-tpm/drivers/char/tpm/tpm_bios.c 2006-04-19 13:53:55.746954250 -0500
@@ -320,6 +321,7 @@ static int tpm_binary_bios_measurements_
/* 5th: delimiter */
seq_putc(m, '\0');

+ kfree(eventname);
return 0;
}

@@ -367,6 +369,7 @@ static int tpm_ascii_bios_measurements_s
/* 4th: eventname <= max + \'0' delimiter */
seq_printf(m, " %s\n", eventname);

+ kfree(eventname);
return 0;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-19 21:20    [W:0.090 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site