mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
bug : vnet get can fail with non exisiting network name
This commit is contained in:
parent
8836e4dcb7
commit
499562a19c
@ -145,7 +145,7 @@ VirtualNetwork * VirtualNetworkPool::get(const string& name, bool lock)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
int oid;
|
||||
int oid = -1;
|
||||
int rc;
|
||||
|
||||
char * sql_name = db->escape_str(name.c_str());
|
||||
@ -166,7 +166,7 @@ VirtualNetwork * VirtualNetworkPool::get(const string& name, bool lock)
|
||||
|
||||
db->free_str(sql_name);
|
||||
|
||||
if (rc != 0)
|
||||
if (rc != 0 || oid == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user