summaryrefslogtreecommitdiff
path: root/code/vconn
diff options
context:
space:
mode:
Diffstat (limited to 'code/vconn')
-rw-r--r--code/vconn/vconn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/code/vconn/vconn.c b/code/vconn/vconn.c
index 3a69092..33fa80b 100644
--- a/code/vconn/vconn.c
+++ b/code/vconn/vconn.c
@@ -471,14 +471,16 @@ int ecp_ctx_vconn_init(ECPContext *ctx) {
ctx->pack_raw = vconn_pack_raw;
#ifdef ECP_WITH_PTHREAD
- pthread_mutex_init(&key_perma_mutex, NULL);
- pthread_mutex_init(&key_next_mutex, NULL);
+ rv = pthread_mutex_init(&key_perma_mutex, NULL);
+ if (!rv) pthread_mutex_init(&key_next_mutex, NULL);
+ if (rv) return ECP_ERR;
#endif
#ifdef ECP_WITH_HTABLE
if (ctx->ht.init) {
key_perma_table = ctx->ht.create(ctx);
key_next_table = ctx->ht.create(ctx);
+ if ((key_perma_table == NULL) || (key_next_table == NULL)) return ECP_ERR;
}
#endif