From 3b43e76247efcef812bdd00827c8f984d8633985 Mon Sep 17 00:00:00 2001 From: jesusc Date: Fri, 19 Sep 2003 05:37:34 +0000 Subject: [PATCH] Fixed segfaults when fclosing a FILE* already closed. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2898 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ as/mcs51/lklibr.c | 2 -- link/z80/lklibr.c | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bc2d441..51b6f2f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-09-18 Jesus Calvino-Fraga + + *link/z80/lklibr.c, as/mcs51/lklibr.c: Fixed Linux segfaults when + trying to fclose a FILE* that was already closed. + 2003-09-18 Erik Petrich * src/SDCCsymt.c (structElemType): fixed bug #808291 (members diff --git a/as/mcs51/lklibr.c b/as/mcs51/lklibr.c index dbb32e82..82d13667 100644 --- a/as/mcs51/lklibr.c +++ b/as/mcs51/lklibr.c @@ -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, "")==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, diff --git a/link/z80/lklibr.c b/link/z80/lklibr.c index 66b97eab..8c413224 100644 --- a/link/z80/lklibr.c +++ b/link/z80/lklibr.c @@ -771,7 +771,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*/ } @@ -1052,7 +1051,6 @@ char *name; if(strcmp(relfil, "")==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, -- 2.30.2