src/libvirt.c (do_open): Avoid double-free upon failure.

This commit is contained in:
Jim Meyering 2008-01-30 19:53:10 +00:00
parent 218f866f86
commit 6997b1920f
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,7 @@
Wed Jan 30 20:49:34 CET 2008 Jim Meyering <meyering@redhat.com> Wed Jan 30 20:49:34 CET 2008 Jim Meyering <meyering@redhat.com>
* src/libvirt.c (do_open): Avoid double-free upon failure.
Avoid segfault upon malloc failure, and plug a leak. Avoid segfault upon malloc failure, and plug a leak.
* src/test.c (testDomainSave): Detect testDomainDumpXML failure. * src/test.c (testDomainSave): Detect testDomainDumpXML failure.
Free "xml". Free "xml".

View File

@ -615,7 +615,6 @@ do_open (const char *name,
return ret; return ret;
failed: failed:
free (ret->name);
if (ret->driver) ret->driver->close (ret); if (ret->driver) ret->driver->close (ret);
if (uri) xmlFreeURI(uri); if (uri) xmlFreeURI(uri);
virUnrefConnect(ret); virUnrefConnect(ret);