mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuSlirpNew: Use g_new0 to allocate the slirp object
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user