Commit 3131496a authored by Paul Coffman's avatar Paul Coffman Committed by Rob Latham
Browse files

small memory leak on Blue Gene



The BGQPLATFORM bridgelist and bridgelistnum hints need to be freed in
ADIOI_Close because of the way the "create on one, reopen on all" logic
and the hint processing logic interact.
Signed-off-by: Rob Latham's avatarRob Latham <robl@mcs.anl.gov>
parent 7ab2a21f
......@@ -64,6 +64,20 @@ void ADIO_Close(ADIO_File fd, int *error_code)
if (fd->hints && fd->hints->ranklist) ADIOI_Free(fd->hints->ranklist);
if (fd->hints && fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list);
/* This BlueGene platform-specific free must be done in the common code
* because the malloc's for these hint data structures are done at the
* scope of ADIO_Open within the SetInfo call (ADIOI_GPFS_SetInfo which
* calls ADIOI_BG_gen_agg_ranklist). They cannot be done in the
* ADIOI_GPFS_Close because of the file creation case where the
* ADIOI_GPFS_Close and re-open via ADIOI_GPFS_Open are done which results
* in a double-free - ADIOI_GPFS_Open does not redo the SetInfo... */
#ifdef BGQPLATFORM
if (fd->hints && fd->hints->fs_hints.bg.bridgelist)
ADIOI_Free(fd->hints->fs_hints.bg.bridgelist);
if (fd->hints && fd->hints->fs_hints.bg.bridgelistnum)
ADIOI_Free(fd->hints->fs_hints.bg.bridgelistnum);
#endif
/* Persistent File Realms */
if (fd->hints->cb_pfr == ADIOI_HINT_ENABLE) {
/* AAR, FSIZE, and User provided uniform File realms */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment