diff --git a/src/rvprof_memory.c b/src/rvprof_memory.c index 0a52957..5ff015a 100644 --- a/src/rvprof_memory.c +++ b/src/rvprof_memory.c @@ -99,8 +99,18 @@ static void cleanup_function_stats(void* item){ } } +static void cleanup_stack_info(void* item){ + stack_info_t* stack = (stack_info_t*)item; + if (stack->stack_path){ + rvprof_free(stack->stack_path, strlen(stack->stack_path)+1); + stack->stack_path = NULL; + } +} + // acutal dynamic array implementations: IMPLEMENT_DYNAMIC_ARRAY(region_t, region, INITIAL_REGIONS, cleanup_region_entry) IMPLEMENT_DYNAMIC_ARRAY(symbol_entry_t, symbol, INITIAL_SYMBOLS, cleanup_symbol_entry) IMPLEMENT_DYNAMIC_ARRAY(function_stats_t, function_stats, INITIAL_FUNCTIONS, cleanup_function_stats) +IMPLEMENT_DYNAMIC_ARRAY(stack_info_t, stack_info, INITIAL_STACKS, cleanup_stack_info) +