mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
src/libvirt.c (do_open): Avoid double-free upon failure.
This commit is contained in:
parent
218f866f86
commit
6997b1920f
@ -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".
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user