diff --git a/toke.l b/toke.l index 1d5bb8c8c..d5fc72400 100644 --- a/toke.l +++ b/toke.l @@ -840,7 +840,7 @@ init_lexer() efree(pl); } efree(istack[idepth].path); - if (!istack[idepth].keepopen) + if (idepth && !istack[idepth].keepopen) fclose(istack[idepth].bs->yy_input_file); yy_delete_buffer(istack[idepth].bs); }