]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
reed_solomon: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:18 +0000 (23:38 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:18 +0000 (23:38 +0300)
Found by: Coverity scan.
CID: 96688

grub-core/lib/reed_solomon.c

index 7263cbc0463ead69283ffb8a33d1fc1b5ebbd19d..ee9fa7b4feb42a063d65ca15f78924253fd81a1e 100644 (file)
@@ -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