all repos — hex @ 400f2ed70d5e4b1adf29633f09dd68320b0e4e11

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Fixes.
h3rald h3rald@h3rald.com
Wed, 21 May 2025 14:03:01 +0200
commit

400f2ed70d5e4b1adf29633f09dd68320b0e4e11

parent

d242a8eac2409649abd777df263f9edac6c6b437

2 files changed, 12 insertions(+), 6 deletions(-)

jump to
M src/hex.csrc/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.csrc/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: