chiark / gitweb /
Move xtrsave(string) to avoid possible memory leak.
[userv.git] / parser.c
index ecfe32239aac292c8c4e313997c5f8320db397fc..fbf0872a1ec2db564178d2905dc1fb73675b5e4d 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1298,9 +1298,9 @@ static int parse_file(const char *string, int *didexist) {
   
   if (didexist) *didexist= 1;
 
-  filename= xstrsave(file);
   ybuf= yy_create_buffer(file,YY_BUF_SIZE);
   if (!ybuf) syscallerror("unable to create flex buffer for file");
+  filename= xstrsave(string);
   parser_push(&usestate,filename,&newstab,ybuf,0);
   fileparselevel++;