Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangrimberg committed Feb 15, 2023
1 parent a5bf24b commit 5a9d33d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions interface/ceed-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,13 +1451,14 @@ int CeedBasisDestroy(CeedBasis *basis) {
if (!*basis || --(*basis)->ref_count > 0) return CEED_ERROR_SUCCESS;
if ((*basis)->Destroy) CeedCall((*basis)->Destroy(*basis));
if ((*basis)->contract) CeedCall(CeedTensorContractDestroy(&(*basis)->contract));
CeedCall(CeedFree(&(*basis)->q_ref_1d));
CeedCall(CeedFree(&(*basis)->q_weight_1d));
CeedCall(CeedFree(&(*basis)->interp));
CeedCall(CeedFree(&(*basis)->interp_1d));
CeedCall(CeedFree(&(*basis)->grad));
CeedCall(CeedFree(&(*basis)->div));
CeedCall(CeedFree(&(*basis)->grad_1d));
CeedCall(CeedFree(&(*basis)->q_ref_1d));
CeedCall(CeedFree(&(*basis)->q_weight_1d));
CeedCall(CeedFree(&(*basis)->div));
CeedCall(CeedFree(&(*basis)->curl));
CeedCall(CeedDestroy(&(*basis)->ceed));
CeedCall(CeedFree(basis));
return CEED_ERROR_SUCCESS;
Expand Down

0 comments on commit 5a9d33d

Please sign in to comment.