Skip to content

Commit

Permalink
Fix a memory leak in the cmpd_dset test
Browse files Browse the repository at this point in the history
This was due to not freeing a test buffer. It was not a core
library memory leak.
  • Loading branch information
derobins committed Mar 5, 2024
1 parent 0be8925 commit b789a76
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions test/cmpd_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva

/* Release buffers */
free(s1);
free(save_s1);
free(s3);
free(save_s3);
free(rbuf1);
Expand Down Expand Up @@ -1145,30 +1146,19 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva
H5E_END_TRY

/* Release resources */
if (s1)
free(s1);
if (s3)
free(s3);
if (save_s3)
free(save_s3);
if (rbuf1)
free(rbuf1);
if (rbuf3)
free(rbuf3);
if (s7)
free(s7);
if (save_s7)
free(save_s7);
if (s8)
free(s8);
if (save_s8)
free(save_s8);
if (rbuf7)
free(rbuf7);
if (rbuf8)
free(rbuf8);
if (save_rbuf8)
free(save_rbuf8);
free(s1);
free(save_s1);
free(s3);
free(save_s3);
free(rbuf1);
free(rbuf3);
free(s7);
free(save_s7);
free(s8);
free(save_s8);
free(rbuf7);
free(rbuf8);
free(save_rbuf8);

printf("\n*** SELECT COMPOUND DATASET TESTS FAILED ***\n");
return 1;
Expand Down

0 comments on commit b789a76

Please sign in to comment.