Fix OOM cleanup in huge_palloc().

Fix OOM cleanup in huge_palloc() to call idalloct() rather than
base_node_dalloc().  This bug is a result of incomplete refactoring, and
has no impact other than leaking memory during OOM.
This commit is contained in:
Jason Evans 2014-12-04 16:42:42 -08:00
parent f79e01f75b
commit 1036ddbf11

View File

@ -48,12 +48,8 @@ huge_palloc(tsd_t *tsd, arena_t *arena, size_t usize, size_t alignment,
*/
is_zeroed = zero;
arena = arena_choose(tsd, arena);
if (unlikely(arena == NULL)) {
base_node_dalloc(node);
return (NULL);
}
ret = arena_chunk_alloc_huge(arena, usize, alignment, &is_zeroed);
if (ret == NULL) {
if (unlikely(arena == NULL) || (ret = arena_chunk_alloc_huge(arena,
usize, alignment, &is_zeroed)) == NULL) {
idalloct(tsd, node, try_tcache);
return (NULL);
}