mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-02 22:48:31 +08:00
tinyexpr: Free all parameters again
This used implicit fallthrough to free all. We still iterate back-to-front (i--) because maybe that's important?
This commit is contained in:
parent
4674784a0b
commit
3bbec871e4
|
@ -110,8 +110,12 @@ static te_expr *new_expr(const int type, const te_expr *parameters[]) {
|
|||
|
||||
void te_free_parameters(te_expr *n) {
|
||||
if (!n) return;
|
||||
const int arity = get_arity(n->type);
|
||||
if (arity > 0) te_free((te_expr *)n->parameters[arity - 1]);
|
||||
int arity = get_arity(n->type);
|
||||
// Free all parameters from the back to the front.
|
||||
while (arity > 0) {
|
||||
te_free((te_expr *)n->parameters[arity - 1]);
|
||||
arity--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user