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

Re: [libvirt] [PATCH 1/2] uml: Avoid resource leak of event in umlInofityEvent



On 01/22/13 15:20, John Ferlan wrote:
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 c6fef69..705495e 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -410,11 +410,13 @@ reread:
          }
          if (dom)
              virObjectUnlock(dom);
+        if (event) {
+            umlDomainEventQueue(driver, event);
+            event = NULL;
+        }

Yeah, it's in a big loop. Took me a while to notice.

      }

  cleanup:
-    if (event)
-        umlDomainEventQueue(driver, event);
      umlDriverUnlock(driver);
  }



ACK.

Peter


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