diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-20 14:24:33 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-20 14:24:33 +0200 |
commit | 2a802888e91a274fa49d341da7744ea9c386b150 (patch) | |
tree | 7a87b42dff73c84fedd0d4407e6ee40ada4e69be | |
parent | bfc295d012efe5117734a2d6799c90af61102a68 (diff) | |
download | ouroboros-2a802888e91a274fa49d341da7744ea9c386b150.tar.gz ouroboros-2a802888e91a274fa49d341da7744ea9c386b150.zip |
lib: Fix bad lock in rib
-rw-r--r-- | src/lib/rib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c index 2645e90b..e59e0d94 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -1407,16 +1407,17 @@ int rib_unpack(uint8_t * packed, ret = rnode_unpack(msg, root, flags); - pthread_rwlock_unlock(&rib.lock); - if (ret == 0 && msg->has_hash) { root = rnode_get_child(root, msg->name); if (memcmp(msg->hash.data, root->sha3, SHA3_256_HASH_LEN)) { ro_msg__free_unpacked(msg, NULL); + pthread_rwlock_unlock(&rib.lock); return -EFAULT; } } + pthread_rwlock_unlock(&rib.lock); + ro_msg__free_unpacked(msg, NULL); free(packed); |