From 6c8449b147ff6ecc5bdf2c38671e495f8ee41109 Mon Sep 17 00:00:00 2001 From: Fabrizio Fabbri Date: Wed, 17 May 2017 21:11:26 +0200 Subject: [PATCH] fix coverity 435052 Dereference before null check https://scan7.coverity.com/reports.htm#v29378/p15116/fileInstanceId=19259832&defectInstanceId=4445114&mergedDefectId=1435052 --- src/c/threads/process.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c/threads/process.d b/src/c/threads/process.d index bde09e30d..a3bb9894d 100755 --- a/src/c/threads/process.d +++ b/src/c/threads/process.d @@ -189,7 +189,7 @@ thread_cleanup(void *aux) cl_env_ptr env = process->process.env; /* The following flags will disable all interrupts. */ AO_store_full((AO_t*)&process->process.phase, ECL_PROCESS_EXITING); - ecl_disable_interrupts_env(env); + if (env) ecl_disable_interrupts_env(env); #ifdef HAVE_SIGPROCMASK /* ...but we might get stray signals. */ {