From: fennecdjay Date: Thu, 6 Jun 2019 16:15:50 +0000 (+0200) Subject: :art: Context name X-Git-Tag: nightly~2445^2 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=67cfe8e924e65c2255c89454ccaccbe48d659e46;p=gwion.git :art: Context name --- 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; }