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>
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;
}