Skip to content

Commit 5a9d33d

Browse files
Fix memory leak
1 parent a5bf24b commit 5a9d33d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

interface/ceed-basis.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1451,13 +1451,14 @@ int CeedBasisDestroy(CeedBasis *basis) {
14511451
if (!*basis || --(*basis)->ref_count > 0) return CEED_ERROR_SUCCESS;
14521452
if ((*basis)->Destroy) CeedCall((*basis)->Destroy(*basis));
14531453
if ((*basis)->contract) CeedCall(CeedTensorContractDestroy(&(*basis)->contract));
1454+
CeedCall(CeedFree(&(*basis)->q_ref_1d));
1455+
CeedCall(CeedFree(&(*basis)->q_weight_1d));
14541456
CeedCall(CeedFree(&(*basis)->interp));
14551457
CeedCall(CeedFree(&(*basis)->interp_1d));
14561458
CeedCall(CeedFree(&(*basis)->grad));
1457-
CeedCall(CeedFree(&(*basis)->div));
14581459
CeedCall(CeedFree(&(*basis)->grad_1d));
1459-
CeedCall(CeedFree(&(*basis)->q_ref_1d));
1460-
CeedCall(CeedFree(&(*basis)->q_weight_1d));
1460+
CeedCall(CeedFree(&(*basis)->div));
1461+
CeedCall(CeedFree(&(*basis)->curl));
14611462
CeedCall(CeedDestroy(&(*basis)->ceed));
14621463
CeedCall(CeedFree(basis));
14631464
return CEED_ERROR_SUCCESS;

0 commit comments

Comments
 (0)