* [Qemu-devel] [PATCH] free the memory malloced by load_at()
@ 2012-11-16 6:47 Olivia Yin
2012-11-19 10:46 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
0 siblings, 1 reply; 2+ messages in thread
From: Olivia Yin @ 2012-11-16 6:47 UTC (permalink / raw)
To: qemu-devel, qemu-ppc; +Cc: Olivia Yin
Signed-off-by: Olivia Yin <hong-hua.yin@freescale.com>
---
hw/elf_ops.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/hw/elf_ops.h b/hw/elf_ops.h
index db4630e..4495932 100644
--- a/hw/elf_ops.h
+++ b/hw/elf_ops.h
@@ -178,6 +178,8 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab,
s->disas_strtab = str;
s->next = syminfos;
syminfos = s;
+ g_free(syms);
+ g_free(str);
g_free(shdr_table);
return 0;
fail:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] free the memory malloced by load_at()
2012-11-16 6:47 [Qemu-devel] [PATCH] free the memory malloced by load_at() Olivia Yin
@ 2012-11-19 10:46 ` Alexander Graf
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2012-11-19 10:46 UTC (permalink / raw)
To: Olivia Yin; +Cc: qemu-ppc, qemu-devel
On 16.11.2012, at 07:47, Olivia Yin wrote:
> Signed-off-by: Olivia Yin <hong-hua.yin@freescale.com>
> ---
> hw/elf_ops.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/elf_ops.h b/hw/elf_ops.h
> index db4630e..4495932 100644
> --- a/hw/elf_ops.h
> +++ b/hw/elf_ops.h
> @@ -178,6 +178,8 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab,
> s->disas_strtab = str;
^
> s->next = syminfos;
> syminfos = s;
> + g_free(syms);
> + g_free(str);
Syms and str can both still be dereferenced at this point in time.
Alex
> g_free(shdr_table);
> return 0;
> fail:
> --
> 1.7.0.4
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-19 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 6:47 [Qemu-devel] [PATCH] free the memory malloced by load_at() Olivia Yin
2012-11-19 10:46 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).