[PATCH 07/14] uml: Avoid resource leak of event in umlInofityEvent

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

 



If there was more than one inotify_event found in the read/while loop,
then only the last event found would have been queued.
---
 src/uml/uml_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 448d292..db6e466 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -410,11 +410,13 @@ reread:
         }
         if (dom)
             virDomainObjUnlock(dom);
+        if (event) {
+            umlDomainEventQueue(driver, event);
+            event = NULL;
+        }
     }
 
 cleanup:
-    if (event)
-        umlDomainEventQueue(driver, event);
     umlDriverUnlock(driver);
 }
 
-- 
1.7.11.7

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


[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]