From a6f7d1abce848da5593ccc39492ef5c1df11a33c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 20 Jun 2015 23:38:18 +0300 Subject: [PATCH] reed_solomon: fix memory leak Found by: Coverity scan. CID: 96688 --- grub-core/lib/reed_solomon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/reed_solomon.c b/grub-core/lib/reed_solomon.c index 7263cbc04..ee9fa7b4f 100644 --- a/grub-core/lib/reed_solomon.c +++ b/grub-core/lib/reed_solomon.c @@ -362,7 +362,7 @@ grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, /* Nothing to do. */ if (!rs) - return; + goto exit; init_powx (); @@ -388,6 +388,7 @@ grub_reed_solomon_add_redundancy (void *buffer, grub_size_t data_size, #ifndef TEST assert (grub_memcmp (tmp, buffer, data_size) == 0); #endif +exit: free (tmp); } #endif