mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
lib: Don't access configuration if none is present
Commit e457d5ef2015e6106094b85f8bbd1582002edc4d adds ability to pass the default URI using the client configuration file. If the file is not present, it still accesses the NULL config object causing a segfault. Caught running "make check".
This commit is contained in:
parent
362c3b33e6
commit
59d0c9801c
@ -1085,7 +1085,8 @@ virConnectOpenResolveURIAlias(virConfPtr conf,
|
|||||||
|
|
||||||
*uri = NULL;
|
*uri = NULL;
|
||||||
|
|
||||||
if ((value = virConfGetValue(conf, "uri_aliases")))
|
if (conf &&
|
||||||
|
(value = virConfGetValue(conf, "uri_aliases")))
|
||||||
ret = virConnectOpenFindURIAliasMatch(value, alias, uri);
|
ret = virConnectOpenFindURIAliasMatch(value, alias, uri);
|
||||||
else
|
else
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user