Index: trunk/src/file.c =================================================================== --- trunk/src/file.c (revision 1304) +++ trunk/src/file.c (revision 1305) @@ -1259,7 +1259,7 @@ int ReadNetlist(char *filename) { - static char *command = NULL; + char *command = NULL; char inputline[MAX_NETLIST_LINE_LENGTH + 1]; char temp[MAX_NETLIST_LINE_LENGTH + 1]; FILE *fp; @@ -1283,14 +1283,15 @@ } else { used_popen = 1; - free(command); command = EvaluateFilename(Settings.RatCommand, Settings.RatPath, filename, NULL); /* open pipe to stdout of command */ if (*command == '\0' || (fp = popen(command, "r")) == NULL) { PopenErrorMessage(command); + free(command); return (1); } + free(command); } lines = 0; /* kind = 0 is net name Index: trunk/src/parse_l.c =================================================================== --- trunk/src/parse_l.c (revision 1304) +++ trunk/src/parse_l.c (revision 1305) @@ -2369,8 +2369,7 @@ else { used_popen = 1; - /* release old command and create new from template */ - free (command); + command = EvaluateFilename(Executable, Path, Filename, Parameter); /* open pipe to stdout of command */ @@ -2377,8 +2376,10 @@ if (*command == '\0' || (yyin = popen(command, "r")) == NULL) { PopenErrorMessage(command); + free(command); return(1); } + free(command); } } else { Index: trunk/src/parse_l.l =================================================================== --- trunk/src/parse_l.l (revision 1304) +++ trunk/src/parse_l.l (revision 1305) @@ -250,8 +250,7 @@ else { used_popen = 1; - /* release old command and create new from template */ - free (command); + command = EvaluateFilename(Executable, Path, Filename, Parameter); /* open pipe to stdout of command */ @@ -258,8 +257,10 @@ if (*command == '\0' || (yyin = popen(command, "r")) == NULL) { PopenErrorMessage(command); + free(command); return(1); } + free(command); } } else {