thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Blob Blame History Raw
From 26622e239160e7dc9811c944d7567f0d8fbb0040 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Tue, 8 Sep 2015 18:06:21 +0200
Subject: [PATCH 3/7] util: Fuse g_malloc(); memset() into g_new0()

Message-id: <1441735585-23432-4-git-send-email-armbru@redhat.com>
Patchwork-id: 67704
O-Subject: [RHEL-7.2 qemu-kvm PATCH 3/7] util: Fuse g_malloc(); memset() into g_new0()
Bugzilla: 1218919
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Fam Zheng <famz@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 9be71be5bda27b068176ab9b982cf3d7d41a4acd)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 util/uri.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/util/uri.c b/util/uri.c
index 01dc09e..918d235 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -1004,8 +1004,7 @@ URI *
 uri_new(void) {
     URI *ret;
 
-    ret = (URI *) g_malloc(sizeof(URI));
-    memset(ret, 0, sizeof(URI));
+    ret = g_new0(URI, 1);
     return(ret);
 }
 
-- 
1.8.3.1