Skip to content

Commit

Permalink
Merge pull request #1691 from CEED/jeremy/small-leak
Browse files Browse the repository at this point in the history
cpu - fix minor leak
  • Loading branch information
jeremylt authored Oct 11, 2024
2 parents f90b231 + 69d19ba commit 748f74a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backends/ref/ceed-ref-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,10 @@ static int CeedOperatorLinearAssembleAddDiagonalAtPoints_Ref(CeedOperator op, Ce
// ---- Check if elem size matches
CeedCallBackend(CeedOperatorFieldGetElemRestriction(op_output_fields[j], &elem_rstr));
CeedCallBackend(CeedElemRestrictionGetType(elem_rstr, &rstr_type));
if (is_active_at_points && rstr_type != CEED_RESTRICTION_POINTS) continue;
if (is_active_at_points && rstr_type != CEED_RESTRICTION_POINTS) {
CeedCallBackend(CeedElemRestrictionDestroy(&elem_rstr));
continue;
}
if (rstr_type == CEED_RESTRICTION_POINTS) {
CeedCallBackend(CeedElemRestrictionGetNumPointsInElement(elem_rstr, e, &elem_size));
} else {
Expand All @@ -1466,7 +1469,10 @@ static int CeedOperatorLinearAssembleAddDiagonalAtPoints_Ref(CeedOperator op, Ce
CeedInt num_comp = 0;

CeedCallBackend(CeedElemRestrictionGetNumComponents(elem_rstr, &num_comp));
if (e_vec_size != num_comp * elem_size) continue;
if (e_vec_size != num_comp * elem_size) {
CeedCallBackend(CeedElemRestrictionDestroy(&elem_rstr));
continue;
}
}

// ---- Basis action
Expand Down

0 comments on commit 748f74a

Please sign in to comment.