From 5783cf42c40aaed9b9180ae7069c7a60ea86dc45 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 13 Nov 2018 10:56:57 +0000 Subject: [PATCH] Use after fix due to task free on non positive counting (#12138) --- libr/core/task.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libr/core/task.c b/libr/core/task.c index 326dfdc560..f83dd7da6f 100644 --- a/libr/core/task.c +++ b/libr/core/task.c @@ -242,12 +242,13 @@ R_API void r_core_task_decref (RCoreTask *task) { return; } TASK_SIGSET_T old_sigset; - tasks_lock_enter (task->core, &old_sigset); + RCore *core = task->core; + tasks_lock_enter (core, &old_sigset); task->refcount--; if (task->refcount <= 0) { task_free (task); } - tasks_lock_leave (task->core, &old_sigset); + tasks_lock_leave (core, &old_sigset); } R_API void r_core_task_schedule(RCoreTask *current, RTaskState next_state) {