diff --git a/arangod/VocBase/barrier.c b/arangod/VocBase/barrier.c index 8cd2d7f271..3a31630e6d 100644 --- a/arangod/VocBase/barrier.c +++ b/arangod/VocBase/barrier.c @@ -143,6 +143,7 @@ bool TRI_ContainsBarrierList (TRI_barrier_list_t* container, TRI_barrier_type_e while (ptr != NULL) { if (ptr->_type == type) { + TRI_UnlockSpin(&container->_lock); return true; } ptr = ptr->_next; diff --git a/lib/ShapedJson/json-shaper.c b/lib/ShapedJson/json-shaper.c index 1b5ac0c335..c3bd64d1ad 100644 --- a/lib/ShapedJson/json-shaper.c +++ b/lib/ShapedJson/json-shaper.c @@ -224,13 +224,17 @@ static TRI_shape_pid_t FindNameAttributePath (TRI_shaper_t* shaper, char const* aids = TRI_Allocate(shaper->_memoryZone, len * sizeof(TRI_shape_aid_t), false); if (aids == NULL) { + TRI_UnlockMutex(&shaper->_attributePathLock); + LOG_ERROR("out of memory in shaper"); return 0; } buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len); if (buffer == NULL) { + TRI_UnlockMutex(&shaper->_attributePathLock); TRI_Free(shaper->_memoryZone, aids); + LOG_ERROR("out of memory in shaper"); return 0; } @@ -256,6 +260,9 @@ static TRI_shape_pid_t FindNameAttributePath (TRI_shaper_t* shaper, char const* result = TRI_Allocate(shaper->_memoryZone, total, false); if (result == NULL) { + TRI_UnlockMutex(&shaper->_attributePathLock); + TRI_Free(shaper->_memoryZone, aids); + LOG_ERROR("out of memory in shaper"); return 0; }