Fixes.
h3rald h3rald@h3rald.com
Wed, 21 May 2025 14:03:01 +0200
2 files changed,
12 insertions(+),
6 deletions(-)
M
src/hex.c
→
src/hex.c
@@ -680,19 +680,22 @@ if (item->data.str_value)
{ hex_debug_item(ctx, "FREE", item); free(item->data.str_value); + item->data.str_value = NULL; // Set to NULL to avoid double free } free(item); // Free the item itself - // item = NULL; + item = NULL; break; case HEX_TYPE_QUOTATION: if (item->data.quotation_value) { hex_debug_item(ctx, "FREE", item); - hex_free_list(ctx, item->data.quotation_value, item->quotation_size); - free(item->data.quotation_value); // Free the array of items + // hex_free_list(ctx, item->data.quotation_value, item->quotation_size); + free(item->data.quotation_value); // Free the array of items + item->data.quotation_value = NULL; // Set to NULL to avoid double free } free(item); // Free the item itself + item = NULL; break; case HEX_TYPE_NATIVE_SYMBOL:@@ -904,7 +907,7 @@ }
} else { - // copy->token = NULL; + copy->token = NULL; } return copy;
M
src/stack.c
→
src/stack.c
@@ -253,9 +253,10 @@ if (item->data.str_value)
{ hex_debug_item(ctx, "FREE", item); free(item->data.str_value); + item->data.str_value = NULL; // Set to NULL to avoid double free } free(item); // Free the item itself - // item = NULL; + item = NULL; break; case HEX_TYPE_QUOTATION:@@ -263,9 +264,11 @@ if (item->data.quotation_value)
{ hex_debug_item(ctx, "FREE", item); hex_free_list(ctx, item->data.quotation_value, item->quotation_size); - free(item->data.quotation_value); // Free the array of items + free(item->data.quotation_value); // Free the array of items + item->data.quotation_value = NULL; // Set to NULL to avoid double free } free(item); // Free the item itself + item = NULL; break; case HEX_TYPE_NATIVE_SYMBOL: