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 5cfee2802f39bb0f487c8fff2e475ef0641013bd..204ae0f9060cd76f5a43ce9ae36e2b01aa45f709 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