[commit: ghc] wip/coverity: Fix potential memory leak in ProfHeap.c (1aed176)

git at git.haskell.org git at git.haskell.org
Wed Apr 23 07:15:20 UTC 2014


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

On branch  : wip/coverity
Link       : http://ghc.haskell.org/trac/ghc/changeset/1aed176f5db8116c7e5cc74afd79996f24338d29/ghc

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

commit 1aed176f5db8116c7e5cc74afd79996f24338d29
Author: Austin Seipp <austin at well-typed.com>
Date:   Wed Apr 23 02:14:15 2014 -0500

    Fix potential memory leak in ProfHeap.c
    
    Discovered by Coverity. CID 43166.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

1aed176f5db8116c7e5cc74afd79996f24338d29
 rts/ProfHeap.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index d21b14a..9079c2b 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -337,6 +337,7 @@ void initProfiling2 (void)
       debugBelch("Can't open profiling report file %s\n",
 	      hp_filename);
       RtsFlags.ProfFlags.doHeapProfile = 0;
+      stgFree(prog);
       return;
     }
   }



More information about the ghc-commits mailing list