Skip to content

Commit

Permalink
Fix PKG memory leak on {s.eval} corner-case
Browse files Browse the repository at this point in the history
Make sure to correctly free the transformation data structures even when
parsed by {s.eval} at runtime, as opposed to one-time parsing during
startup, which would never highlight the leak:

    $var(proxy) = "$(du{nameaddr.uri}{re.subst,/scscf-int-/scscf-/})";
    $var(proxy) = $(var(proxy){s.eval});

Fixes #3233

(cherry picked from commit be764a1)
  • Loading branch information
liviuchircu committed Nov 15, 2023
1 parent 2e4495b commit 7b106be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -5006,6 +5006,9 @@ int pv_elem_free_all(pv_elem_p log)
{
t = log;
log = log->next;

if (t->spec.trans)
free_transformation((trans_t *)t->spec.trans);
pkg_free(t);
}
return 0;
Expand Down

0 comments on commit 7b106be

Please sign in to comment.