diff --git a/opal/mca/mpool/base/mpool_base_tree.c b/opal/mca/mpool/base/mpool_base_tree.c index bcdbbf1e64..c59ec01c51 100644 --- a/opal/mca/mpool/base/mpool_base_tree.c +++ b/opal/mca/mpool/base/mpool_base_tree.c @@ -182,6 +182,9 @@ void mca_mpool_base_tree_print(int show_up_to_mem_leaks) num_leaks = 0; max_mem_leaks = show_up_to_mem_leaks; opal_rb_tree_traverse(&mca_mpool_base_tree, condition, action); + if (0 == num_leaks) { + return; + } if (num_leaks <= show_up_to_mem_leaks || show_up_to_mem_leaks < 0) {