]> git.gag.com Git - fw/sdcc/commitdiff
fclose FILE * != NULL
authorjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 6 Jul 2003 22:11:31 +0000 (22:11 +0000)
committerjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 6 Jul 2003 22:11:31 +0000 (22:11 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2725 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/librarian/sdcclib.c

index 6b191799b743d1f2c5beb9cf7625aa6ce8679443..ef058e7ae165d6425d2ce21225b3f9299ec23c5f 100644 (file)
@@ -204,7 +204,7 @@ void AddRel(void)
         if(rel==NULL)
         {
             printf("ERROR: Couldn't open file '%s'", RelName);
-            fclose(lib);
+            if(lib!=NULL) fclose(lib);
             return;
         }
     }
@@ -214,7 +214,7 @@ void AddRel(void)
     if(newlib==NULL)
     {
         printf("ERROR: Couldn't create temporary file '%s'", LibNameTmp);
-        fclose(lib);
+        if(lib!=NULL) fclose(lib);
         fclose(rel);
         return;
     }
@@ -224,7 +224,7 @@ void AddRel(void)
     if(libindex==NULL)
     {
         printf("ERROR: Couldn't create temporary file '%s'", IndexName);
-        fclose(lib);
+        if(lib!=NULL) fclose(lib);
         fclose(newlib);
         fclose(rel);
         return;