From f70ce394f152328facd2d5d73328715469436dae Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 24 Mar 2019 06:40:17 -0600 Subject: [PATCH] fixed remap memory leak --- src/clib/pioc.c | 3 ++- src/clib/pioc_support.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clib/pioc.c b/src/clib/pioc.c index 3575a33a64a..50b119375d1 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -526,7 +526,8 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in break; } } - if (iodesc->needssort){ + if (iodesc->needssort) + { struct sort_map *tmpsort; if (!(tmpsort = malloc(sizeof(struct sort_map) * maplen))) diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index 646f3867dc2..9c8372f682d 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -789,6 +789,9 @@ int PIOc_freedecomp(int iosysid, int ioid) /* Free the dimlens. */ free(iodesc->dimlen); + if (iodesc->remap) + free(iodesc->remap); + LOG((3, "freeing rfrom, rtype")); if (iodesc->rfrom) free(iodesc->rfrom);