summaryrefslogtreecommitdiff
path: root/src/libvirt-host.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2023-02-03 15:38:03 +0100
committerMichal Privoznik <mprivozn@redhat.com>2023-02-08 16:50:45 +0100
commit77d417d9efccd4b4f85218d9f0c1c0b6e94f388f (patch)
treede3edb089dac60b652a15dfbc9b5c4ec9de24698 /src/libvirt-host.c
parent65b9d9a6197a94be207dca1d30c97064282e620c (diff)
downloadlibvirt-77d417d9efccd4b4f85218d9f0c1c0b6e94f388f.tar.gz
Drop checks for virURIFormat() retval
The virURIFormat() function either returns a string, or aborts (on OOM). There's no way this function can return NULL (as of v7.2.0-rc1~277). Therefore, it doesn't make sense to check its retval against NULL. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Diffstat (limited to 'src/libvirt-host.c')
-rw-r--r--src/libvirt-host.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index c02222346c..a2ba347d54 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -313,21 +313,13 @@ virConnectGetHostname(virConnectPtr conn)
char *
virConnectGetURI(virConnectPtr conn)
{
- char *name;
VIR_DEBUG("conn=%p", conn);
virResetLastError();
virCheckConnectReturn(conn, NULL);
- if (!(name = virURIFormat(conn->uri)))
- goto error;
-
- return name;
-
- error:
- virDispatchError(conn);
- return NULL;
+ return virURIFormat(conn->uri);
}