This function doesn't have an overly verbose cleanup section as there
isn't any error code path. Unify it with the rest of the functions which
will simplify adding a possible error path.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
qemuMigrationParamsPtr
qemuMigrationParamsFromJSON(virJSONValuePtr params)
{
- qemuMigrationParamsPtr migParams;
+ g_autoptr(qemuMigrationParams) migParams = NULL;
qemuMigrationParamValuePtr pv;
const char *name;
const char *str;
return NULL;
if (!params)
- return migParams;
+ return g_steal_pointer(&migParams);
for (i = 0; i < QEMU_MIGRATION_PARAM_LAST; i++) {
name = qemuMigrationParamTypeToString(i);
}
}
- return migParams;
+ return g_steal_pointer(&migParams);
}