[libvirt PATCH 2/2] remote: dispatch: free and close infiles too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/remote/remote_daemon_dispatch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 510856024c..e468bbf261 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -4693,7 +4693,7 @@ qemuDispatchDomainMonitorCommandWithFiles(virNetServer *server G_GNUC_UNUSED,
                                           qemu_domain_monitor_command_with_files_ret *ret)
 {
     virDomainPtr dom = NULL;
-    int *infiles = NULL;
+    g_autofree int *infiles = NULL;
     unsigned int ninfiles = 0;
     int *outfiles = NULL;
     unsigned int noutfiles = 0;
@@ -4736,6 +4736,9 @@ qemuDispatchDomainMonitorCommandWithFiles(virNetServer *server G_GNUC_UNUSED,
         rv = 0;
 
  cleanup:
+    for (i = 0; i < ninfiles; i++)
+        VIR_FORCE_CLOSE(infiles[i]);
+
     for (i = 0; i < noutfiles; i++)
         VIR_FORCE_CLOSE(outfiles[i]);
 
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux