mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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.
This commit is contained in:
parent
4002395dd7
commit
d7d910d98d
@ -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 (ipsock) {
|
||||
if (config->listen_tcp) {
|
||||
|
Loading…
Reference in New Issue
Block a user