Skip to content

Commit 304d535

Browse files
committed
[libesl] Coverity 1546296 Check of thread-shared field evades lock acquisition
1 parent e75944a commit 304d535

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libs/esl/src/esl.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,11 +1531,15 @@ ESL_DECLARE(esl_status_t) esl_send_recv_timed(esl_handle_t *handle, const char *
15311531
const char *hval;
15321532
esl_status_t status;
15331533

1534-
if (!handle || !handle->connected || handle->sock == ESL_SOCK_INVALID) {
1535-
return ESL_FAIL;
1536-
}
1534+
if (!handle) {
1535+
return ESL_FAIL;
1536+
}
15371537

15381538
esl_mutex_lock(handle->mutex);
1539+
if (!handle->connected || handle->sock == ESL_SOCK_INVALID) {
1540+
esl_mutex_unlock(handle->mutex);
1541+
return ESL_FAIL;
1542+
}
15391543

15401544
esl_event_safe_destroy(&handle->last_sr_event);
15411545

0 commit comments

Comments
 (0)