qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] oslib-posix: change free to g_free
@ 2014-10-11  2:54 arei.gonglei
  2014-10-11  3:10 ` zhanghailiang
  2014-10-11  3:23 ` Eric Blake
  0 siblings, 2 replies; 9+ 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] 9+ messages in thread

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

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

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).