Skip to content

Commit

Permalink
Fix Task Coverities #10401 (#10416)
Browse files Browse the repository at this point in the history
  • Loading branch information
thestr4ng3r authored and Anton Kochkov committed Jun 20, 2018
1 parent 2637196 commit 3feb950
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libr/core/task.c
Expand Up @@ -101,7 +101,7 @@ R_API RCoreTask *r_core_task_new (RCore *core, const char *cmd, RCoreTaskCallbac
task->res = NULL;
task->dispatch_cond = r_th_cond_new ();
task->dispatch_lock = r_th_lock_new (false);
if (!task->dispatch_cond || !task->dispatch_cond) {
if (!task->dispatch_cond || !task->dispatch_lock) {
goto hell;
}

Expand Down Expand Up @@ -288,10 +288,12 @@ R_API int r_core_task_run_sync(RCore *core, RCoreTask *task) {
/* begin running stuff synchronously on the main task */
R_API void r_core_task_sync_begin(RCore *core) {
RCoreTask *task = core->main_task;
r_th_lock_enter (core->tasks_lock);
task->thread = NULL;
task->cmd = NULL;
task->cmd_log = false;
task->state = R_CORE_TASK_STATE_BEFORE_START;
r_th_lock_leave (core->tasks_lock);
task_wakeup (task);
}

Expand Down

0 comments on commit 3feb950

Please sign in to comment.