From 3fdd5211d96952989fbd7b0cfacd30628c6ab57c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 27 Oct 2022 13:24:35 -0400 Subject: Facilitate memory cleanup --- Lua/lbp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Lua') diff --git a/Lua/lbp.c b/Lua/lbp.c index 7c5db3e..462995d 100644 --- a/Lua/lbp.c +++ b/Lua/lbp.c @@ -33,9 +33,11 @@ static void push_match(lua_State *L, match_t *m, const char *start); lua_State *cur_state = NULL; -static void match_error(const char *msg) +static void match_error(char **msg) { - lua_pushstring(cur_state, msg); + lua_pushstring(cur_state, *msg); + free(*msg); + *msg = NULL; lua_error(cur_state); } -- cgit v1.2.3