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");
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, ":");
}
AliInfo(Form("Configuring token=%s",token));
TObject *obj;
- TIter next (dirlist);
+ TIter next (&dirlist);
TString found = "\0";
while ((obj = next ()))
token = strtok (NULL," ");
}
- if (dirlist) delete dirlist;
-
}
/*****************************************************************************/