]> xenbits.xensource.com Git - libvirt.git/commitdiff
uml: Avoid resource leak of event in umlInofityEvent
authorJohn Ferlan <jferlan@redhat.com>
Tue, 22 Jan 2013 14:20:06 +0000 (09:20 -0500)
committerEric Blake <eblake@redhat.com>
Tue, 22 Jan 2013 16:14:13 +0000 (09:14 -0700)
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

index c6fef698a8af1feacf12c2731f88e7e0541a2e94..705495e8c650cfb9c2786b8f3593b5b7e3db26f7 100644 (file)
@@ -410,11 +410,13 @@ reread:
         }
         if (dom)
             virObjectUnlock(dom);
+        if (event) {
+            umlDomainEventQueue(driver, event);
+            event = NULL;
+        }
     }
 
 cleanup:
-    if (event)
-        umlDomainEventQueue(driver, event);
     umlDriverUnlock(driver);
 }