提交 ef21beda 编写于 作者: E Eric Blake

libvirtd: avoid leak on failure

Spotted by Coverity.  Only possible on an OOM condition, so
unlikely to bite in the wild.

* daemon/libvirtd.c (qemudSetLogging): Don't leak memory.
上级 bb889529
......@@ -2779,8 +2779,10 @@ qemudSetLogging(struct qemud_server *server, virConfPtr conf,
goto free_and_fail;
if (virAsprintf(&tmp, "%d:file:%s/.libvirt/libvirtd.log",
virLogGetDefaultPriority(), userdir) == -1)
virLogGetDefaultPriority(), userdir) == -1) {
VIR_FREE(userdir);
goto out_of_memory;
}
}
} else {
if (virAsprintf(&tmp, "%d:stderr", virLogGetDefaultPriority()) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册