Now that it's only used once.

Signed-off-by: Ján Tomko <jto...@redhat.com>
---
 src/qemu/qemu_command.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6557643dbe..e47f30876e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9196,7 +9196,7 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
 {
     VIR_AUTOPTR(virJSONValue) memProps = NULL;
     VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-    char *devstr = NULL;
+    VIR_AUTOFREE(char *) devstr = NULL;
     VIR_AUTOFREE(char *) chardev = NULL;
     int rc;
     unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
@@ -9259,13 +9259,10 @@ qemuBuildShmemCommandLine(virLogManagerPtr logManager,
     if (!devstr)
         return -1;
 
-    if (qemuCommandAddExtDevice(cmd, &shmem->info) < 0) {
-        VIR_FREE(devstr);
+    if (qemuCommandAddExtDevice(cmd, &shmem->info) < 0)
         return -1;
-    }
 
     virCommandAddArgList(cmd, "-device", devstr, NULL);
-    VIR_FREE(devstr);
 
     if (shmem->server.enabled) {
         chardev = qemuBuildChrChardevStr(logManager, secManager,
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to