]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliConfig.cxx
Do not reset a zero pointer to MC info
[u/mrichter/AliRoot.git] / STEER / AliConfig.cxx
index cf0eaf018745745f4a278d64106639b9c4b1eaa0..ac7bccabde1f71af01718ab853262fe9af203cd8 100644 (file)
@@ -399,7 +399,7 @@ void    AliConfig::Add (char *list)
   
   const char   *confPath = gSystem->Getenv ("ALICE_CONFIG_PATH");
   if  (confPath) {
-    path = new char[strlen (confPath)];
+    path = new char[strlen (confPath)+1];
     strcpy (path, confPath);
   } else {
     const char   *alice = gSystem->Getenv ("ALICE_ROOT");
@@ -414,11 +414,13 @@ void    AliConfig::Add (char *list)
   
   char   *token = strtok (path, ":");
   
-  TList  *dirlist = new TList;
+  TList dirlist;
+  
+  dirlist.SetOwner(kTRUE);
   
   while (token != NULL)        
     {
-      dirlist->Add (new TObjString(token));
+      dirlist.Add (new TObjString(token));
       token = strtok (NULL, ":");
     }
   
@@ -429,7 +431,7 @@ void    AliConfig::Add (char *list)
       AliInfo(Form("Configuring token=%s",token));
       
       TObject *obj;
-      TIter   next (dirlist);
+      TIter   next (&dirlist);
       TString found = "\0";
       
       while ((obj = next ()))
@@ -484,8 +486,6 @@ void    AliConfig::Add (char *list)
       token = strtok (NULL," ");
     }
   
-  if (dirlist) delete dirlist;
-  
 }
 
 /*****************************************************************************/