From: Kylene Jo Hall Date: Sat, 22 Apr 2006 09:36:35 +0000 (-0700) Subject: [PATCH] tpm: fix memory leak X-Git-Tag: v2.6.17-rc3~49 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59e89f3a091d5cf93f4b176aedcfded61ece5252;p=linux-2.6 [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: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 537aa45d8c..0549e2a35d 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c @@ -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; } @@ -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; }