1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #2985 oned can segfault after successfully allocating a new virtual network (#2989)

This commit is contained in:
Christian González 2019-02-27 15:17:31 +01:00 committed by Ruben S. Montero
parent b0879ebbfa
commit bb3db27bec

View File

@ -146,6 +146,12 @@ int VirtualNetworkPool::allocate (
{
vn = get(*oid);
if (vn == 0)
{
error_str = "An error occurred while allocating the virtual network.";
goto error_common;
}
if ( set_vlan_id(vn) != 0 )
{
error_str = "Cannot automatically assign VLAN_ID to network.";
@ -165,6 +171,9 @@ error_duplicated:
error_str = oss.str();
delete vn;
error_common:
*oid = -1;
return *oid;