]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
event: avoid memory leak on cleanup
authorEric Blake <eblake@redhat.com>
Thu, 2 Jun 2011 22:54:09 +0000 (16:54 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 3 Jun 2011 14:11:43 +0000 (08:11 -0600)
Detected by Coverity.  Introduced in commit aaf2b70, and turned into
a regression in the next few commits through 4e6e6672 (unreleased).

* src/conf/domain_event.c (virDomainEventStateFree): Free object,
per documentation.

src/conf/domain_event.c

index 34a9d9118b40c8bfa2db77d58faf034640f5e6f9..fabc1a53368bef13b1d1b93faef23f12d2c09809 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * domain_event.c: domain event queue processing helpers
  *
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
  * Copyright (C) 2008 VirtualIron
  *
  * This library is free software; you can redistribute it and/or
@@ -555,6 +555,7 @@ virDomainEventStateFree(virDomainEventStatePtr state)
 
     if (state->timer != -1)
         virEventRemoveTimeout(state->timer);
+    VIR_FREE(state);
 }
 
 /**