Fixing potential minor memory leak.
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Jan 2011 13:48:03 +0000 (13:48 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Jan 2011 13:48:03 +0000 (13:48 +0000)
HLT/trigger/AliHLTGlobalTrigger.cxx

index 5cfee28..204ae0f 100644 (file)
@@ -43,7 +43,11 @@ AliHLTGlobalTrigger* AliHLTGlobalTrigger::CreateNew(const char* name)
     // was compiled. So assuming that this is an interpreted class. In this case
     // we need to use a interface wrapper class to make things work properly.
     AliHLTGlobalTriggerWrapper* trigger = new AliHLTGlobalTriggerWrapper(name);
-    if (not trigger->IsValid()) return NULL;
+    if (not trigger->IsValid())
+    {
+      delete trigger;
+      return NULL;
+    }
     return trigger;
   }
   else