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

This commit is contained in:
Christian González authored and Ruben S. Montero committed 2019-02-27 15:17:31 +01:00
1 parent b0879ebbfa
commit bb3db27bec
1 file changed
+9
+9
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;