From: Andrei Borzenkov Date: Sat, 20 Jun 2015 20:38:18 +0000 (+0300) Subject: reed_solomon: fix memory leak X-Git-Tag: 2.02-beta3~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6f7d1abce848da5593ccc39492ef5c1df11a33c;p=thirdparty%2Fgrub.git reed_solomon: fix memory leak Found by: Coverity scan. CID: 96688 --- 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