On Tue, Apr 02, 2019 at 17:41:44 +0200, Ján Tomko wrote:
The only remaining use of VIR_FREE is for reusing variables.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
tests/virjsontest.c | 42 ++++++++++++++----------------------------
1 file changed, 14 insertions(+), 28 deletions(-)
diff --git a/tests/virjsontest.c b/tests/virjsontest.c
index bf2bb85c6c..12458878e0 100644
--- a/tests/virjsontest.c
+++ b/tests/virjsontest.c
@@ -22,7 +22,7 @@ testJSONFromString(const void *data)
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);
@@ -58,7 +58,6 @@ testJSONFromString(const void *data)
ret = 0;
cleanup:
- VIR_FREE(formatted);
return ret;
}
@@ -69,10 +68,10 @@ testJSONAddRemove(const void *data)
const struct testInfo *info = data;
VIR_AUTOPTR(virJSONValue) json = NULL;
VIR_AUTOPTR(virJSONValue) name = 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;
These were added in 1/n of this series. I've seen you had a R-b there
but consider not changing recently added code.
int ret = -1;
if (virAsprintf(&infile, "%s/virjsondata/add-remove-%s-in.json",
ACK