1
0
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:
Ruben S. Montero 2010-04-25 23:31:09 +02:00
parent 8836e4dcb7
commit 499562a19c

View File

@ -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;
}