From bb41695449030bee6b5679096ebe3d8f7ddd9a68 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 16 Nov 2011 21:38:00 +0100 Subject: [PATCH] * grub-core/kern/dl.c (grub_dl_unload): Fix freeing segments. --- ChangeLog | 4 ++++ grub-core/kern/dl.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3fd9bf78..1c000592f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-11-16 Vladimir Serbinenko + + * grub-core/kern/dl.c (grub_dl_unload): Fix freeing segments. + 2011-11-16 Vladimir Serbinenko * grub-core/kern/x86_64/efi/callwrap.S: Fix the comment. diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 26cf0d21d..345e80b90 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -729,7 +729,6 @@ int grub_dl_unload (grub_dl_t mod) { grub_dl_dep_t dep, depn; - grub_dl_segment_t seg, segn; if (mod->ref_count > 0) return 0; @@ -749,13 +748,7 @@ grub_dl_unload (grub_dl_t mod) grub_free (dep); } - for (seg = mod->segment; seg; seg = segn) - { - segn = seg->next; - grub_free (seg->addr); - grub_free (seg); - } - + grub_free (mod->base); grub_free (mod->name); #ifdef GRUB_MODULES_MACHINE_READONLY grub_free (mod->symtab);