[commit: ghc] ghc-7.8: rts: Fix leak of file archive handle (652789e)

git at git.haskell.org git at git.haskell.org
Tue Apr 29 21:10:26 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/652789e77d84f95120360211281f3771ae3e8e17/ghc

>---------------------------------------------------------------

commit 652789e77d84f95120360211281f3771ae3e8e17
Author: Austin Seipp <austin at well-typed.com>
Date:   Tue Apr 29 09:05:38 2014 -0500

    rts: Fix leak of file archive handle
    
    Issue discovered by Coverity Scan, CID 43171.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>
    (cherry picked from commit e597f5feb065c075c86715e24bf0ebd341fa8b9e)


>---------------------------------------------------------------

652789e77d84f95120360211281f3771ae3e8e17
 rts/Linker.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/rts/Linker.c b/rts/Linker.c
index c577cce..75389d5 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2618,6 +2618,7 @@ loadArchive( pathchar *path )
 
             if (0 == loadOc(oc)) {
                 stgFree(fileName);
+                fclose(f);
                 return 0;
             }
         }



More information about the ghc-commits mailing list