Skip to content

Commit

Permalink
FIX memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed May 27, 2024
1 parent 13e2034 commit 9cdcb52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/expressions/ExprManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ ExprResult ExprManager::evaluate(ExprContextObject* exprContextObjectP, const st
// The ExprResult::fill() method allocates dynamic memory. So, the callers to evaluate() are supposed to invoke ExprResult::release()
// method to free it
r.fill(result);

// cjexl_eval() allocated memory for us. We have to release it in order to avoid a leak
free((char*)result);

TIME_EXPR_JEXL_EVAL_STOP();
}

Expand Down

0 comments on commit 9cdcb52

Please sign in to comment.