summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-06-20 13:33:13 +0100
committerSimon Marlow <marlowsd@gmail.com>2016-06-20 15:00:22 +0100
commite7e42c838e32ef1e05daf04b0b6afb62ffc4ec97 (patch)
tree3327171b1c2c6687acb9d5ed8d1d43d65152cae4 /rts/Schedule.c
parent0ba34b6bac988228948c65ae11d9e08afe82c878 (diff)
downloadhaskell-e7e42c838e32ef1e05daf04b0b6afb62ffc4ec97.tar.gz
Fix double-free in T5644 (#12208)
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index fca276dc08..d9ab913ad4 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);