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

jiputer posted 1 patch 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261108193433.225841-1-jpaulma23@gmail.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>
contrib/vhost-user-bridge/vhost-user-bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] contrib/vhost-user-bridge/vhost-user-bridge: Convert calloc to g_new0
Posted by jiputer 2 weeks ago
In the function, vubr_new, calloc was converted to g_new0.

Signed-off-by: jiputer <jpaulma23@gmail.com>
---

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

diff --git a/contrib/vhost-user-bridge/vhost-user-bridge.c b/contrib/vhost-user-bridge/vhost-user-bridge.c
index a6f7ec226c..e3b979b462 100644
--- a/contrib/vhost-user-bridge/vhost-user-bridge.c
+++ b/contrib/vhost-user-bridge/vhost-user-bridge.c
@@ -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
Re: [PATCH] contrib/vhost-user-bridge/vhost-user-bridge: Convert calloc to g_new0
Posted by Marc-André Lureau 1 week, 6 days ago
On Mon, Nov 9, 2026 at 12:40 AM jiputer <jpaulma23@gmail.com> wrote:
>
> In the function, vubr_new, calloc was converted to g_new0.
>
> Signed-off-by: jiputer <jpaulma23@gmail.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>
> 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(-)
>
> diff --git a/contrib/vhost-user-bridge/vhost-user-bridge.c b/contrib/vhost-user-bridge/vhost-user-bridge.c
> index a6f7ec226c..e3b979b462 100644
> --- a/contrib/vhost-user-bridge/vhost-user-bridge.c
> +++ b/contrib/vhost-user-bridge/vhost-user-bridge.c
> @@ -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
>
>


-- 
Marc-André Lureau