提交 d7d910d9 编写于 作者: P Peter Krempa

daemon: Add the admin service to the admin server only if it was allocated

If the admin service is disabled it would not be allocated, but the NULL
pointer still would be added to the admin server. Since
virNetServerAddService would dereference it, the daemon would crash.

Move the service registration into the block that allocates it.
上级 4002395d
......@@ -534,10 +534,10 @@ daemonSetupNetworking(virNetServerPtr srv,
config->admin_max_queued_clients,
config->admin_max_client_requests)))
goto error;
}
if (virNetServerAddService(srvAdm, svcAdm, NULL) < 0)
goto error;
if (virNetServerAddService(srvAdm, svcAdm, NULL) < 0)
goto error;
}
if (ipsock) {
if (config->listen_tcp) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册