[PATCH 14/15] qemuSlirpNew: Use g_new0 to allocate the slirp object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_slirp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c
index 3efc34bcf0..d9105b0ff6 100644
--- a/src/qemu/qemu_slirp.c
+++ b/src/qemu/qemu_slirp.c
@@ -81,10 +81,9 @@ qemuSlirpHasFeature(const qemuSlirp *slirp,
 qemuSlirpPtr
 qemuSlirpNew(void)
 {
-    g_autoptr(qemuSlirp) slirp = NULL;
+    g_autoptr(qemuSlirp) slirp = g_new0(qemuSlirp, 1);

-    if (VIR_ALLOC(slirp) < 0 ||
-        !(slirp->features = virBitmapNew(QEMU_SLIRP_FEATURE_LAST)))
+    if (!(slirp->features = virBitmapNew(QEMU_SLIRP_FEATURE_LAST)))
         return NULL;

     slirp->pid = (pid_t)-1;
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux