if (g_atomic_int_get(&hasCreateWithNetwork)) {
g_autoptr(virError) error = NULL;
- if (VIR_ALLOC(error) < 0)
- return -1;
+ error = g_new0(virError, 1);
guuid = g_variant_new_fixed_array(G_VARIANT_TYPE("y"),
uuid, 16, sizeof(unsigned char));
if (!(conn = virGDBusGetSystemBus()))
return -1;
- if (VIR_ALLOC(error) < 0)
- return -1;
+ error = g_new0(virError, 1);
/*
* The systemd DBus API we're invoking has the
virSystemdActivationEntryPtr ent = virHashLookup(act->fds, name);
if (!ent) {
- if (VIR_ALLOC(ent) < 0)
- return -1;
-
- if (VIR_ALLOC_N(ent->fds, 1) < 0) {
- virSystemdActivationEntryFree(ent);
- return -1;
- }
-
+ ent = g_new0(virSystemdActivationEntry, 1);
+ ent->fds = g_new0(int, 1);
ent->fds[ent->nfds++] = fd;
VIR_DEBUG("Record first FD %d with name %s", fd, name);
const char *fdnames;
VIR_DEBUG("Activated with %d FDs", nfds);
- if (VIR_ALLOC(act) < 0)
- return NULL;
+ act = g_new0(virSystemdActivation, 1);
if (!(act->fds = virHashCreate(10, virSystemdActivationEntryFree)))
goto error;