All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] oslib-posix: change free to g_free
@ 2014-10-11  2:54 ` arei.gonglei
  0 siblings, 0 replies; 18+ messages in thread
From: arei.gonglei @ 2014-10-11  2:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, weidong.huang, qemu-trivial, Gonglei, stefanha, pbonzini

From: Gonglei <arei.gonglei@huawei.com>

The caller of qemu_vfree() maybe not check whether parameter
ptr pointer is NULL or not, such as vpc_open().
Using g_free() is more safe.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 016a047..ca435d0 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -153,7 +153,7 @@ void *qemu_anon_ram_alloc(size_t size)
 void qemu_vfree(void *ptr)
 {
     trace_qemu_vfree(ptr);
-    free(ptr);
+    g_free(ptr);
 }
 
 void qemu_anon_ram_free(void *ptr, size_t size)
-- 
1.7.12.4




^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-10-12  7:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11  2:54 [Qemu-trivial] [PATCH] oslib-posix: change free to g_free arei.gonglei
2014-10-11  2:54 ` [Qemu-devel] " arei.gonglei
2014-10-11  3:10 ` [Qemu-trivial] " zhanghailiang
2014-10-11  3:10   ` zhanghailiang
2014-10-11  3:21   ` [Qemu-trivial] " Gonglei
2014-10-11  3:21     ` Gonglei
2014-10-11  3:26     ` [Qemu-trivial] " Eric Blake
2014-10-11  3:26       ` Eric Blake
2014-10-11  3:32       ` [Qemu-trivial] " Gonglei
2014-10-11  3:32         ` Gonglei
2014-10-11  3:44         ` [Qemu-trivial] " Eric Blake
2014-10-11  3:44           ` Eric Blake
2014-10-11  3:47           ` [Qemu-trivial] " Gonglei
2014-10-11  3:47             ` Gonglei
2014-10-11  3:23 ` [Qemu-trivial] " Eric Blake
2014-10-11  3:23   ` Eric Blake
2014-10-12  7:44   ` [Qemu-trivial] " Kevin Wolf
2014-10-12  7:44     ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.