mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
xenconfig: fix issue found by coverity in multiple IP support
virStringSplit may return NULL, so we must handle that. Cc: John Ferlan <jferlan@redhat.com> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This commit is contained in:
parent
a609389310
commit
9f8778dfca
@ -968,6 +968,9 @@ xenParseVif(virConfPtr conf, virDomainDefPtr def, const char *vif_typename)
|
|||||||
char **ip_list = virStringSplit(ip, " ", 0);
|
char **ip_list = virStringSplit(ip, " ", 0);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
if (!ip_list)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
for (i = 0; ip_list[i]; i++) {
|
for (i = 0; ip_list[i]; i++) {
|
||||||
if (virDomainNetAppendIPAddress(net, ip_list[i], 0, 0) < 0) {
|
if (virDomainNetAppendIPAddress(net, ip_list[i], 0, 0) < 0) {
|
||||||
virStringListFree(ip_list);
|
virStringListFree(ip_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user