Avoid memory leak in define when macro is redefined.
@@ -2077,8 +2077,10 @@ static void define (c2m_ctx_t c2m_ctx) {
}
} else if (m->replacement == NULL) {
error (c2m_ctx, id->pos, "standard macro %s redefinition", name);
- } else if (!params_eq_p (m->params, params) || !replacement_eq_p (m->replacement, repl)) {
+ } else {
+ if (!params_eq_p (m->params, params) || !replacement_eq_p (m->replacement, repl))
error (c2m_ctx, id->pos, "different macro redefinition of %s", name);
+ VARR_DESTROY (token_t, repl);
}
}
