]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuMonitorTestAddInvalidCommandResponse: VIR_AUTOFREE
authorJán Tomko <jtomko@redhat.com>
Sat, 15 Jun 2019 10:07:04 +0000 (12:07 +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 75f6be2038b4139ed290a7f5875017a6667563d1..85a2fca659775b3e2d20c0abd3c96f0f16b6f404 100644 (file)
@@ -174,17 +174,13 @@ qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test,
                                          const char *expectedcommand,
                                          const char *actualcommand)
 {
-    char *msg;
-    int ret;
+    VIR_AUTOFREE(char *) msg = NULL;
 
     if (virAsprintf(&msg, "expected command '%s' got '%s'",
                     expectedcommand, actualcommand) < 0)
         return -1;
 
-    ret = qemuMonitorTestAddErrorResponse(test, msg);
-
-    VIR_FREE(msg);
-    return ret;
+    return qemuMonitorTestAddErrorResponse(test, msg);
 }