projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d71cdbf
)
macio: fix possible memory leak
author
Gonglei
<arei.gonglei@huawei.com>
Fri, 27 Feb 2015 07:50:14 +0000
(15:50 +0800)
committer
Michael Tokarev
<mjt@tls.msk.ru>
Tue, 10 Mar 2015 05:15:34 +0000
(08:15 +0300)
If ret = macio_initfn_ide() is less than 0, the timer_memory
will leak the memory it points to.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/misc/macio/macio.c
patch
|
blob
|
blame
|
history
diff --git
a/hw/misc/macio/macio.c
b/hw/misc/macio/macio.c
index 9bc3f2d908e1437037c6d6216c10bc22b05fbdf0..063ad80412561d4a57f2629b529125169df5ac26 100644
(file)
--- a/
hw/misc/macio/macio.c
+++ b/
hw/misc/macio/macio.c
@@
-273,7
+273,7
@@
static int macio_newworld_initfn(PCIDevice *d)
MacIOState *s = MACIO(d);
NewWorldMacIOState *ns = NEWWORLD_MACIO(d);
SysBusDevice *sysbus_dev;
- MemoryRegion *timer_memory =
g_new(MemoryRegion, 1)
;
+ MemoryRegion *timer_memory =
NULL
;
int i;
int cur_irq = 0;
int ret = macio_common_initfn(d);
@@
-301,6
+301,7
@@
static int macio_newworld_initfn(PCIDevice *d)
}
/* Timer */
+ timer_memory = g_new(MemoryRegion, 1);
memory_region_init_io(timer_memory, OBJECT(s), &timer_ops, NULL, "timer",
0x1000);
memory_region_add_subregion(&s->bar, 0x15000, timer_memory);
This page took
0.030513 seconds
and
4
git commands to generate.