diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-10-27 13:24:35 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-10-27 13:24:35 -0400 |
| commit | 3fdd5211d96952989fbd7b0cfacd30628c6ab57c (patch) | |
| tree | 505dbd4be5f4ea89f211e4d05eeba2e023aa46fd /Lua/lbp.c | |
| parent | e258645a523c5fb4407be4a9e90df1314b225191 (diff) | |
Facilitate memory cleanup
Diffstat (limited to 'Lua/lbp.c')
| -rw-r--r-- | Lua/lbp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |
