Fixed segfaults when fclosing a FILE* already closed.
[fw/sdcc] / as / mcs51 / lklibr.c
index dbb32e82196dddc08261ac978fb7b4fa38f9409c..82d136678327c8eecf329d728da8070c14772223 100644 (file)
@@ -914,7 +914,6 @@ int buildlibraryindex(void)
                 /*Get the built in index of a library*/
                                This=buildlibraryindex_SdccLib(lbnh->libspc, libfp, str, This);
                                free(str);
-                               fclose(libfp);
                                break; /*get the index for next library*/
                        }
                 
@@ -1064,7 +1063,6 @@ char *name;
                        if(strcmp(relfil, "<SDCCLIB>")==0)
                        {
                                result=SdccLib(lbnh->libspc, libfp, str, name);
-                               fclose(libfp);
                                if(result) return(1); /*Found the symbol*/
                                free(str);
                                /*The symbol is not in the current library,