]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Resolve valgrind error
authorJohn Ferlan <jferlan@redhat.com>
Mon, 29 Apr 2013 11:52:49 +0000 (07:52 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 30 Apr 2013 17:26:22 +0000 (13:26 -0400)
As a result of commit id '19c345f2', 'make -C tests valgrind' has the
following for qemuxml2argvtest:

==22482== 197 (80 direct, 117 indirect) bytes in 1 blocks are definitely lost in loss record 101 of 120
==22482==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==22482==    by 0x4C6F301: virAlloc (viralloc.c:124)
==22482==    by 0x4C840FC: virSaveLastError (virerror.c:308)
==22482==    by 0x431882: qemuBuildCommandLine (qemu_command.c:8204)
==22482==    by 0x41E8F0: testCompareXMLToArgvHelper (qemuxml2argvtest.c:155)
==22482==    by 0x41FE9F: virtTestRun (testutils.c:157)
==22482==    by 0x419DEB: mymain (qemuxml2argvtest.c:654)
==22482==    by 0x4204DA: virtTestMain (testutils.c:719)
==22482==    by 0x39D0821A04: (below main) (libc-start.c:225)
==22482==

src/qemu/qemu_command.c

index 3184e5b9c3289227da9df527b4b5f1c4c92717be..7d851e37864d9e88e50500d65cb5aaf54794c51d 100644 (file)
@@ -8208,6 +8208,7 @@ error:
     for (i = 0; i <= last_good_net; i++)
         virDomainConfNWFilterTeardown(def->nets[i]);
     virSetError(originalError);
+    virFreeError(originalError);
     virCommandFree(cmd);
     return NULL;
 }