1
0
Fork 0

added missing unlocks in case of memory errors

This commit is contained in:
Jan Steemann 2012-09-07 16:53:14 +02:00
parent 1ef35bab96
commit 595956a6b5
1 changed files with 6 additions and 0 deletions

View File

@ -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,8 @@ 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);
LOG_ERROR("out of memory in shaper");
return 0;
}