Skip to content

Commit c1257cf

Browse files
committed
mpool/base: plug a memory leak
set the key of all mpool_tree_item objects, so they can be retrieved in mpool_base_free and then returned back to the mca_mpool_base_tree_item_free_list free list. Refs. #4567 Thanks Philip Blakely for the bug report. Signed-off-by: Gilles Gouaillardet <[email protected]> (cherry picked from commit 11e5f86)
1 parent fdc6759 commit c1257cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opal/mca/mpool/base/mpool_base_alloc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* Copyright (c) 2010 IBM Corporation. All rights reserved.
1515
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
17+
* Copyright (c) 2017 Research Organization for Information Science
18+
* and Technology (RIST). All rights reserved.
1719
* $COPYRIGHT$
1820
*
1921
* Additional copyrights may follow
@@ -97,6 +99,7 @@ void *mca_mpool_base_alloc(size_t size, opal_info_t *info, const char *hints)
9799
mca_mpool_base_tree_item_put (mpool_tree_item);
98100
} else {
99101
mpool_tree_item->mpool = mpool;
102+
mpool_tree_item->key = mem;
100103
mca_mpool_base_tree_insert (mpool_tree_item);
101104
}
102105

0 commit comments

Comments
 (0)