Skip to content

Commit 2c2d1d7

Browse files
committed
Missing mutex unlocks in error path, found by Coverity.
1 parent d1bc2dc commit 2c2d1d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/simple_http.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ get_cyassl_ctx(void)
156156
/* Allow TLSv1.0 up to TLSv1.2 */
157157
if ( (cyassl_ctx = CyaSSL_CTX_new(CyaTLSv1_client_method())) == NULL){
158158
debug(LOG_ERR, "Could not create CYASSL context.");
159+
UNLOCK_CYASSL_CTX();
159160
return NULL;
160161
}
161162

@@ -164,6 +165,7 @@ get_cyassl_ctx(void)
164165
err = CyaSSL_CTX_set_cipher_list(cyassl_ctx, config->ssl_cipher_list);
165166
if (SSL_SUCCESS != err) {
166167
debug(LOG_ERR, "Could not load SSL cipher list (error %d)", err);
168+
UNLOCK_CYASSL_CTX();
167169
return NULL;
168170
}
169171
}
@@ -181,6 +183,7 @@ get_cyassl_ctx(void)
181183
debug(LOG_ERR, "Make sure that SSLCertPath points to the correct path in the config file");
182184
debug(LOG_ERR, "Or disable certificate loading with 'SSLPeerVerification No'.");
183185
}
186+
UNLOCK_CYASSL_CTX();
184187
return NULL;
185188
}
186189
} else {

0 commit comments

Comments
 (0)