aboutsummaryrefslogtreecommitdiff
path: root/Lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-10-27 13:24:35 -0400
committerBruce Hill <bruce@bruce-hill.com>2022-10-27 13:24:35 -0400
commit3fdd5211d96952989fbd7b0cfacd30628c6ab57c (patch)
tree505dbd4be5f4ea89f211e4d05eeba2e023aa46fd /Lua
parente258645a523c5fb4407be4a9e90df1314b225191 (diff)
Facilitate memory cleanup
Diffstat (limited to 'Lua')
-rw-r--r--Lua/lbp.c6
1 files changed, 4 insertions, 2 deletions
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);
}