[libvirt] [PATCH 08/12] tests: qemuMonitorReportError: use VIR_AUTOFREE

Ján Tomko jtomko at redhat.com
Sat Jun 15 11:54:06 UTC 2019


Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 tests/qemumonitortestutils.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index f1104e0ff9..313ecb01fd 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -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;
 }
 
-- 
2.20.1




More information about the libvir-list mailing list