const struct testInfo *info = data;
VIR_AUTOPTR(virJSONValue) json = NULL;
const char *expectstr = info->expect ? info->expect : info->doc;
- char *formatted = NULL;
+ VIR_AUTOFREE(char *) formatted = NULL;
int ret = -1;
json = virJSONValueFromString(info->doc);
ret = 0;
cleanup:
- VIR_FREE(formatted);
return ret;
}
const struct testInfo *info = data;
VIR_AUTOPTR(virJSONValue) json = NULL;
virJSONValuePtr value = NULL;
- char *result = NULL;
+ VIR_AUTOFREE(char *) result = NULL;
int rc;
int number;
const char *str;
ret = 0;
cleanup:
- VIR_FREE(result);
return ret;
}
const struct testInfo *info = data;
VIR_AUTOPTR(virJSONValue) json = NULL;
VIR_AUTOPTR(virJSONValue) jsonCopy = NULL;
- char *result = NULL;
- char *resultCopy = NULL;
+ VIR_AUTOFREE(char *) result = NULL;
+ VIR_AUTOFREE(char *) resultCopy = NULL;
int ret = -1;
json = virJSONValueFromString(info->doc);
ret = 0;
cleanup:
- VIR_FREE(result);
- VIR_FREE(resultCopy);
return ret;
}
const struct testInfo *info = data;
VIR_AUTOPTR(virJSONValue) injson = NULL;
VIR_AUTOPTR(virJSONValue) deflattened = NULL;
- char *infile = NULL;
- char *indata = NULL;
- char *outfile = NULL;
- char *actual = NULL;
+ VIR_AUTOFREE(char *) infile = NULL;
+ VIR_AUTOFREE(char *) indata = NULL;
+ VIR_AUTOFREE(char *) outfile = NULL;
+ VIR_AUTOFREE(char *) actual = NULL;
int ret = -1;
if (virAsprintf(&infile, "%s/virjsondata/deflatten-%s-in.json",
ret = 0;
cleanup:
- VIR_FREE(infile);
- VIR_FREE(indata);
- VIR_FREE(outfile);
- VIR_FREE(actual);
return ret;
}
VIR_AUTOPTR(virJSONValue) json = NULL;
VIR_AUTOPTR(virJSONValue) nestjson = NULL;
VIR_AUTOPTR(virJSONValue) parsejson = NULL;
- char *neststr = NULL;
- char *result = NULL;
+ VIR_AUTOFREE(char *) neststr = NULL;
+ VIR_AUTOFREE(char *) result = NULL;
const char *parsednestedstr;
int ret = -1;
ret = 0;
cleanup:
- VIR_FREE(neststr);
- VIR_FREE(result);
return ret;
}