mirror of https://gitee.com/bigwinds/arangodb
added missing unlocks in case of memory errors
This commit is contained in:
parent
1ef35bab96
commit
595956a6b5
|
@ -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);
|
aids = TRI_Allocate(shaper->_memoryZone, len * sizeof(TRI_shape_aid_t), false);
|
||||||
|
|
||||||
if (aids == NULL) {
|
if (aids == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len);
|
buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len);
|
||||||
|
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
TRI_Free(shaper->_memoryZone, aids);
|
TRI_Free(shaper->_memoryZone, aids);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,6 +260,8 @@ static TRI_shape_pid_t FindNameAttributePath (TRI_shaper_t* shaper, char const*
|
||||||
result = TRI_Allocate(shaper->_memoryZone, total, false);
|
result = TRI_Allocate(shaper->_memoryZone, total, false);
|
||||||
|
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue