From 0bf7092ffc8f8eba406548cd971fd1aec5a35c18 Mon Sep 17 00:00:00 2001
From: "Ruben S. Montero" <rubensm@dacya.ucm.es>
Date: Thu, 6 May 2010 00:24:29 +0200
Subject: [PATCH] bug: memory leak when a VM has a wrong template

---
 src/vm/VirtualMachinePool.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/vm/VirtualMachinePool.cc b/src/vm/VirtualMachinePool.cc
index 9bed8646ef..106d3f521b 100644
--- a/src/vm/VirtualMachinePool.cc
+++ b/src/vm/VirtualMachinePool.cc
@@ -192,6 +192,8 @@ int VirtualMachinePool::allocate (
         NebulaLog::log("ONE", Log::ERROR, oss);
         free(error_msg);
 
+        delete vm;
+
         return -2;
     }