[commit: ghc] master: Fix double-free in T5644 (#12208) (e7e42c8)

git at git.haskell.org git at git.haskell.org
Mon Jun 20 13:56:34 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e7e42c838e32ef1e05daf04b0b6afb62ffc4ec97/ghc

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

commit e7e42c838e32ef1e05daf04b0b6afb62ffc4ec97
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Mon Jun 20 13:33:13 2016 +0100

    Fix double-free in T5644 (#12208)


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

e7e42c838e32ef1e05daf04b0b6afb62ffc4ec97
 rts/Schedule.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rts/Schedule.c b/rts/Schedule.c
index fca276d..d9ab913 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1867,8 +1867,6 @@ delete_threads_and_gc:
         }
         task->cap = cap;
     }
-
-    stgFree(idle_cap);
 #endif
 
     if (heap_overflow && sched_state < SCHED_INTERRUPTING) {
@@ -1897,6 +1895,8 @@ delete_threads_and_gc:
 #endif
 
 #if defined(THREADED_RTS)
+    stgFree(idle_cap);
+
     if (gc_type == SYNC_GC_SEQ) {
         // release our stash of capabilities.
         releaseAllCapabilities(n_capabilities, cap, task);



More information about the ghc-commits mailing list