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".
---
src/libvirt.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 1c0cdf7..d0b1b28 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1085,7 +1085,8 @@ virConnectOpenResolveURIAlias(virConfPtr conf,
*uri = NULL;
- if ((value = virConfGetValue(conf, "uri_aliases")))
+ if (conf &&
+ (value = virConfGetValue(conf, "uri_aliases")))
ret = virConnectOpenFindURIAliasMatch(value, alias, uri);
else
ret = 0;
--
1.7.3.4