summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorxor2003 <xorrezerv2@list.ru>2014-10-24 16:01:58 +0400
committerxor2003 <xorrezerv2@list.ru>2014-10-24 16:01:58 +0400
commit69c9f68573028397a025794c2c5771b1da4c1832 (patch)
tree8e0f3a1c0766274ed7b56fbe9f481cb6b6f29cb5 /toxcore
parent6b0fe7eb41ad7c59c976d9715dc9f8e95938a410 (diff)
Prevent lock
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/net_crypto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index cfc7d366..ddb0cc92 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -1322,8 +1322,10 @@ static int create_crypto_connection(Net_Crypto *c)
1322 ++c->crypto_connections_length; 1322 ++c->crypto_connections_length;
1323 memset(&(c->crypto_connections[id]), 0, sizeof(Crypto_Connection)); 1323 memset(&(c->crypto_connections[id]), 0, sizeof(Crypto_Connection));
1324 1324
1325 if (pthread_mutex_init(&c->crypto_connections[id].mutex, NULL) != 0) 1325 if (pthread_mutex_init(&c->crypto_connections[id].mutex, NULL) != 0) {
1326 pthread_mutex_unlock(&c->connections_mutex);
1326 return -1; 1327 return -1;
1328 }
1327 } 1329 }
1328 1330
1329 pthread_mutex_unlock(&c->connections_mutex); 1331 pthread_mutex_unlock(&c->connections_mutex);