Skip to content

Commit db71a07

Browse files
authored
Merge pull request #153 from namsic/unlock-sasl_startup_state
Unlock mutex before return if `sasl_startup_function` fails
2 parents 86e5ead + 09b8344 commit db71a07

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libmemcached/sasl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_instance_st
180180
(void) pthread_mutex_lock(&sasl_startup_state_LOCK);
181181
if (sasl_startup_state != SASL_OK) {
182182
const char *sasl_error_msg = sasl_errstring(sasl_startup_state, NULL, NULL);
183+
(void) pthread_mutex_unlock(&sasl_startup_state_LOCK);
183184
return memcached_set_error(*server, MEMCACHED_AUTH_PROBLEM, MEMCACHED_AT,
184185
memcached_string_make_from_cstr(sasl_error_msg));
185186
}

0 commit comments

Comments
 (0)