* [Qemu-devel] [PATCH] usb/desc-msos: using g_free instead of free in usb_desc_msos()
@ 2015-01-19 3:42 arei.gonglei
2015-01-19 7:27 ` Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: arei.gonglei @ 2015-01-19 3:42 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, kraxel
From: Gonglei <arei.gonglei@huawei.com>
It's important to match g_malloc() with g_free(), plain
malloc() with free(). Otherwise bad things can happen,
since these allocators may use different memory pools.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/usb/desc-msos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/desc-msos.c b/hw/usb/desc-msos.c
index 334d1ae..32c3600 100644
--- a/hw/usb/desc-msos.c
+++ b/hw/usb/desc-msos.c
@@ -231,7 +231,7 @@ int usb_desc_msos(const USBDesc *desc, USBPacket *p,
length = len;
}
memcpy(dest, buf, length);
- free(buf);
+ g_free(buf);
p->actual_length = length;
return 0;
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-19 7:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 3:42 [Qemu-devel] [PATCH] usb/desc-msos: using g_free instead of free in usb_desc_msos() arei.gonglei
2015-01-19 7:27 ` Gerd Hoffmann
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).