summaryrefslogtreecommitdiff
path: root/code/vconn
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-08-16 21:21:33 +0200
committerUros Majstorovic <majstor@majstor.org>2017-08-16 21:21:33 +0200
commit8f44e2151cb3f91b220c4a3393a06068d0ee7302 (patch)
tree8320c304887ac9b0d922bc27b51330c084f34ee0 /code/vconn
parent38e2385f5846860916f8880d818b3b024b8c7dd9 (diff)
fixed rbuf; fixed error code for pthread_mitex_init
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