mirror of https://gitee.com/openkylin/libvirt.git
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
src/xenconfig
|
@ -968,6 +968,9 @@ xenParseVif(virConfPtr conf, virDomainDefPtr def, const char *vif_typename)
|
|||
char **ip_list = virStringSplit(ip, " ", 0);
|
||||
size_t i;
|
||||
|
||||
if (!ip_list)
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; ip_list[i]; i++) {
|
||||
if (virDomainNetAppendIPAddress(net, ip_list[i], 0, 0) < 0) {
|
||||
virStringListFree(ip_list);
|
||||
|
|
Loading…
Reference in New Issue