[Pkg-libvirt-commits] [libguestfs] 81/146: tests: Fix memory leaks in test-add-libvirt-dom.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 17:00:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 653fa9ce671b22d99cf532d058a2a4168ed31558
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Mon Dec 15 17:28:30 2014 +0000
tests: Fix memory leaks in test-add-libvirt-dom.
Found by valgrind.
This fixes commit df9782ec3a12ac46e1b8ffa31630c7a1e64162fe
and commit 96158d42f5cb9b6c472b4630f2c97edae600f6d3.
(cherry picked from commit f843abe400bc4e6fbcbee5f6cda2f3e9da33909a)
---
tests/c-api/test-add-libvirt-dom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/c-api/test-add-libvirt-dom.c b/tests/c-api/test-add-libvirt-dom.c
index 4768f8e..0c2ff28 100644
--- a/tests/c-api/test-add-libvirt-dom.c
+++ b/tests/c-api/test-add-libvirt-dom.c
@@ -120,7 +120,8 @@ main (int argc, char *argv[])
}
/* Create the libvirt connection. */
- snprintf (libvirt_uri, sizeof libvirt_uri, "test://%s/test-add-libvirt-dom.xml", cwd);
+ snprintf (libvirt_uri, sizeof libvirt_uri,
+ "test://%s/test-add-libvirt-dom.xml", cwd);
conn = virConnectOpenReadOnly (libvirt_uri);
if (!conn) {
err = virGetLastError ();
@@ -145,6 +146,10 @@ main (int argc, char *argv[])
guestfs_close (g);
+ virDomainFree (dom);
+ virConnectClose (conn);
+ free (cwd);
+
unlink ("test-add-libvirt-dom.xml");
unlink ("test-add-libvirt-dom-1.img");
unlink ("test-add-libvirt-dom-2.img");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list