Skip to content

Commit

Permalink
[PATCH] tpm: fix memory leak
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Kylene Jo Hall authored and Linus Torvalds committed Apr 22, 2006
1 parent b9251b8 commit 59e89f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/tpm/tpm_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
/* 5th: delimiter */
seq_putc(m, '\0');

kfree(eventname);
return 0;
}

Expand Down Expand Up @@ -353,6 +354,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
/* 4th: eventname <= max + \'0' delimiter */
seq_printf(m, " %s\n", eventname);

kfree(eventname);
return 0;
}

Expand Down

0 comments on commit 59e89f3

Please sign in to comment.