From 8eacdff4c8f8d2f879d9d414f281a4c1a19e77b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 14 Jun 2019 21:38:40 +0200 Subject: [PATCH] qemu: monitor: use VIR_AUTOFREE in qemuMonitor*VideoSize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Acked-by: Peter Krempa --- src/qemu/qemu_monitor.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a88aa2cee0..a292455d4b 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1205,7 +1205,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, const char *videoName) { int ret = -1; - char *path = NULL; + VIR_AUTOFREE(char *) path = NULL; QEMU_CHECK_MONITOR(mon); @@ -1219,9 +1219,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, return -1; } - ret = qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); - VIR_FREE(path); - return ret; + return qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); } @@ -1237,7 +1235,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, const char *videoName) { int ret = -1; - char *path = NULL; + VIR_AUTOFREE(char *) path = NULL; QEMU_CHECK_MONITOR(mon); @@ -1251,9 +1249,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, return -1; } - ret = qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); - VIR_FREE(path); - return ret; + return qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); } -- GitLab