Skip to content

Commit

Permalink
fixed memory leak on error warning from codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Mar 25, 2019
1 parent ed7a0ee commit eed88a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/clib/pioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in
if (!(tmpsort = malloc(sizeof(struct sort_map) * maplen)))
return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__);
if (!(iodesc->remap = malloc(sizeof(int) * maplen)))
{
free(tmpsort);
return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__);
}
for (int m=0; m < maplen; m++)
{
tmpsort[m].remap = m;
Expand Down

0 comments on commit eed88a7

Please sign in to comment.