bug : vnet get can fail with non exisiting network name

This commit is contained in:
Ruben S. Montero committed 2010-04-25 23:31:09 +02:00
1 parent 8836e4dcb7
commit 499562a19c
1 file changed
+2 -2
+2 -2
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;
}