]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuMonitorReportError: use VIR_AUTOFREE
authorJán Tomko <jtomko@redhat.com>
Sat, 15 Jun 2019 10:01:05 +0000 (12:01 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 17 Jun 2019 14:12:57 +0000 (16:12 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
tests/qemumonitortestutils.c

index 806c0dfa66143bbf056d3d27db14e57c5e5f08b7..691111cbacb3865e26aed78151d87746881e0e8f 100644 (file)
@@ -197,8 +197,8 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)
 {
     va_list msgargs;
     VIR_AUTOFREE(char *) tmp = NULL;
-    char *msg = NULL;
-    char *jsonmsg = NULL;
+    VIR_AUTOFREE(char *) msg = NULL;
+    VIR_AUTOFREE(char *) jsonmsg = NULL;
     int ret = -1;
 
     va_start(msgargs, errmsg);
@@ -219,8 +219,6 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)
 
  cleanup:
     va_end(msgargs);
-    VIR_FREE(msg);
-    VIR_FREE(jsonmsg);
     return ret;
 }