提交 6997b192 编写于 作者: J Jim Meyering

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

上级 218f866f
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, ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册