Commit 59e89f3a authored by Kylene Jo Hall's avatar Kylene Jo Hall Committed by Linus Torvalds

[PATCH] tpm: fix memory leak

The eventname was kmalloc'd and not freed in the *_show functions.

This bug was found by Coverity.
Signed-off-by: default avatarKylene Hall <kjhall@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b9251b82
...@@ -306,6 +306,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) ...@@ -306,6 +306,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
/* 5th: delimiter */ /* 5th: delimiter */
seq_putc(m, '\0'); seq_putc(m, '\0');
kfree(eventname);
return 0; return 0;
} }
...@@ -353,6 +354,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) ...@@ -353,6 +354,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
/* 4th: eventname <= max + \'0' delimiter */ /* 4th: eventname <= max + \'0' delimiter */
seq_printf(m, " %s\n", eventname); seq_printf(m, " %s\n", eventname);
kfree(eventname);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment