From 67cfe8e924e65c2255c89454ccaccbe48d659e46 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 6 Jun 2019 18:15:50 +0200 Subject: [PATCH] :art: Context name --- src/oo/context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/oo/context.c b/src/oo/context.c index 98486df1..45695dfc 100644 --- a/src/oo/context.c +++ b/src/oo/context.c @@ -11,14 +11,15 @@ ANN static void free_context(const Context a, Gwion gwion) { REM_REF(a->nspc, gwion) + xfree(a->name); mp_free(gwion->mp, Context, a); } ANN2(2) Context new_context(MemPool p, const Ast ast, const m_str str) { const Context context = mp_calloc(p, Context); - context->nspc = new_nspc(p, str); + context->name = strdup(str); + context->nspc = new_nspc(p, context->name); context->tree = ast; - context->name = str; context->ref = new_refcount(p, free_context); return context; } -- 2.43.0