Skip to content

Commit

Permalink
fixed memory leak on error
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Mar 20, 2019
1 parent b58ac3f commit cffcd55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/clib/pio_getput_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,14 @@ int PIOc_get_var_tc(int ncid, int varid, nc_type xtype, void *buf)

/* Find the dimension lengths. */
for (int d = 0; d < ndims; d++)
{
if ((ierr = PIOc_inq_dimlen(ncid, dimids[d], &countp[d])))
{
free(startp);
free(countp);
return pio_err(ios, file, ierr, __FILE__, __LINE__);
}
}

/* Set up start array. */
for (int d = 0; d < ndims; d++)
Expand Down

0 comments on commit cffcd55

Please sign in to comment.