1
1

allocator/bucket: free all memory associated with a bucket allocator

when it is finalized.

Fixes a leak identified by valgrind.

cmr=v1.8.2:reviewer=jsquyres

This commit was SVN r31767.
Этот коммит содержится в:
Nathan Hjelm 2014-05-14 21:15:39 +00:00
родитель 279c0a3ca7
Коммит 32a85c6d7d

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -10,6 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reseved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -45,8 +48,17 @@ static int mca_allocator_num_buckets;
int mca_allocator_bucket_finalize(struct mca_allocator_base_module_t* allocator)
{
mca_allocator_bucket_t *bucket = (mca_allocator_bucket_t *) allocator;
mca_allocator_bucket_cleanup(allocator);
for (int i = 0 ; i < bucket->num_buckets ; ++i) {
OBJ_DESTRUCT(&bucket->buckets[i].lock);
}
free (bucket->buckets);
free(allocator);
return(OMPI_SUCCESS);
}