testQemuCommandBuildFromJSON(const void *opaque)
{
const testQemuCommandBuildObjectFromJSONData *data = opaque;
- virJSONValue *val = NULL;
+ g_autoptr(virJSONValue) val = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autofree char *result = NULL;
int ret = -1;
ret = 0;
cleanup:
- virJSONValueFree(val);
return ret;
}
const char *pathprefix = "qemumonitorjsondata/qemumonitorjson-nodename-";
g_autofree char *resultFile = NULL;
g_autofree char *actual = NULL;
- virJSONValue *namedNodesJson = NULL;
- virJSONValue *blockstatsJson = NULL;
+ g_autoptr(virJSONValue) namedNodesJson = NULL;
+ g_autoptr(virJSONValue) blockstatsJson = NULL;
GHashTable *nodedata = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
int ret = -1;
cleanup:
virHashFree(nodedata);
- virJSONValueFree(namedNodesJson);
- virJSONValueFree(blockstatsJson);
return ret;
}
const struct testQAPISchemaData *data = opaque;
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
virJSONValue *schemaroot;
- virJSONValue *json = NULL;
+ g_autoptr(virJSONValue) json = NULL;
int ret = -1;
if (virQEMUQAPISchemaPathGet(data->query, data->schema, &schemaroot) < 0)
cleanup:
- virJSONValueFree(json);
return ret;
}
virQEMUDriver driver;
testQemuMonitorJSONSimpleFuncData simpleFunc;
struct testQAPISchemaData qapiData;
- virJSONValue *metaschema = NULL;
+ g_autoptr(virJSONValue) metaschema = NULL;
g_autofree char *metaschemastr = NULL;
if (qemuTestDriverInit(&driver) < 0)
DO_TEST(qemuMonitorJSONGetCPUModelBaseline);
cleanup:
- virJSONValueFree(metaschema);
virHashFree(qapiData.schema);
qemuTestDriverFree(&driver);
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;