Introducing basic_free_stack_if_not_null by anutosh491 · Pull Request #2643 · lcompilers/lpython
Addressing #2614 (comment)
We have been using the basic_free_stack out of symengine's C wrapper untill now. But before freeing out variables we need to check if they have been stack allocated previously. Hence this PR aims to replace every basic_free_stack call with
if (var != NULL) {
basic_free_stack(var);
}