From e061a1b537b1f8b719bfa69c49bdf39877fdf4d7 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 23 Jun 2011 20:58:35 +0200 Subject: [PATCH] * grub-core/lib/reed_solomon.c (rs_recover) [STANDALONE]: Prevent memory leak. --- ChangeLog | 6 ++++++ grub-core/lib/reed_solomon.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index c267a8a0f..327b52afc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ +2011-06-23 Vladimir Serbinenko + + * grub-core/lib/reed_solomon.c (rs_recover) [STANDALONE]: + Prevent memory leak. + 2011-06-23 Vladimir Serbinenko * grub-core/lib/reed_solomon.c (rs_recover): Prevent memory leak. (main): Close file. + Reported by: David Volgyes . 2011-06-23 Vladimir Serbinenko diff --git a/grub-core/lib/reed_solomon.c b/grub-core/lib/reed_solomon.c index 8b5e8235a..365b76003 100644 --- a/grub-core/lib/reed_solomon.c +++ b/grub-core/lib/reed_solomon.c @@ -277,6 +277,11 @@ rs_recover (gf_single_t *m, grub_size_t s, grub_size_t rs) free (errpot); free (errpos); free (sy); +#else + scratch -= rs2 * sizeof (gf_single_t); + scratch -= rs2 * sizeof (gf_single_t); + scratch -= rs2 * sizeof (int); + scratch -= rs * sizeof (gf_single_t); #endif return; }