提交 92f8c3fc 编写于 作者: D Daniel P. Berrange

Fix leak on OOM in qemuMonitorCommonTestNew

Don't leak the path string in qemuMonitorCommonTestNew if
an OOM occurs.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 4f209434
......@@ -793,6 +793,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
src->type = VIR_DOMAIN_CHR_TYPE_UNIX;
src->data.nix.path = (char *)path;
src->data.nix.listen = false;
path = NULL;
if (virNetSocketListen(test->server, 1) < 0)
goto error;
......@@ -801,6 +802,7 @@ cleanup:
return test;
error:
VIR_FREE(path);
VIR_FREE(tmpdir_template);
qemuMonitorTestFree(test);
test = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册