From: Gonglei <arei.gong...@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.gong...@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



Reply via email to