Now freeing tokens associated to symbols.
h3rald h3rald@h3rald.com
Sun, 24 Nov 2024 18:13:04 +0000
1 files changed,
5 insertions(+),
0 deletions(-)
jump to
M
hex.c
→
hex.c
@@ -429,6 +429,7 @@ hex_debug_element(" POP", HEX_STACK[HEX_TOP]);
return HEX_STACK[HEX_TOP--]; } +void hex_free_token(HEX_Token *token); void hex_debug(const char *format, ...); char *hex_type(HEX_ElementType type);@@ -459,11 +460,15 @@ else if (element.type == HEX_TYPE_NATIVE_SYMBOL && element.symbolName != NULL)
{ free(element.symbolName); element.symbolName = NULL; + hex_free_token(element.token); + element.token = NULL; } else if (element.type == HEX_TYPE_USER_SYMBOL && element.symbolName != NULL) { free(element.symbolName); element.symbolName = NULL; + hex_free_token(element.token); + element.token = NULL; } }