mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virURIFormat: abort() on failure
If the argument of 'xmlSaveUri' is non-NULL the function returns NULL on OOM failure only. Thus we can directly abort rather than try to do the impossible recovery. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
06fc9f8e32
commit
cc622f5548
@ -238,11 +238,9 @@ virURIFormat(virURIPtr uri)
|
||||
if (!xmluri.server && !xmluri.port)
|
||||
xmluri.port = -1;
|
||||
|
||||
ret = (char *)xmlSaveUri(&xmluri);
|
||||
if (!ret) {
|
||||
virReportOOMError();
|
||||
return NULL;
|
||||
}
|
||||
/* xmlSaveUri can fail only on OOM condition if argument is non-NULL */
|
||||
if (!(ret = (char *)xmlSaveUri(&xmluri)))
|
||||
abort();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user