Skip to contentSkip to conversation

contrib/vhost-user-bridge/vhost-user-bridge: Convert calloc to g_new0

PATCH In review jiputer 2 participants 2 messages Nov 8 – Nov 9

lore
Share & tools
lore

jiputer

author
#0 lore raw

PATCH 1/1 contrib/vhost-user-bridge/vhost-user-bridge: Convert calloc to g_new0

In the function, vubr_new, calloc was converted to g_new0.

---

This patch belongs to this issue:
https://gitlab.com/qemu-project/qemu/-/work_items/1798

 contrib/vhost-user-bridge/vhost-user-bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/vhost-user-bridge/vhost-user-bridge.c +1 -1
index a6f7ec226c..e3b979b462 100644
@@ -540,7 +540,7 @@ vubr_accept_cb(int sock, void *ctx)
 static VubrDev *
 vubr_new(const char *path, bool client)
 {
-    VubrDev *dev = (VubrDev *) calloc(1, sizeof(VubrDev));
+    VubrDev *dev = g_new0(VubrDev, 1);
     struct sockaddr_un un;
     CallbackFunc cb;
     size_t len;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · jiputer

In the function, vubr_new, calloc was converted to g_new0.

Quoted 25 lines

---

This patch belongs to this issue:
https://gitlab.com/qemu-project/qemu/-/work_items/1798

 contrib/vhost-user-bridge/vhost-user-bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/vhost-user-bridge/vhost-user-bridge.c +1 -2
index a6f7ec226c..e3b979b462 100644
@@ -540,7 +540,7 @@ vubr_accept_cb(int sock, void *ctx)
 static VubrDev *
 vubr_new(const char *path, bool client)
 {
-    VubrDev *dev = (VubrDev *) calloc(1, sizeof(VubrDev));
+    VubrDev *dev = g_new0(VubrDev, 1);
     struct sockaddr_un un;
     CallbackFunc cb;
     size_t len;
--

2.43.0

Signature · 1 line
Marc-André Lureau