Skip to content
Snippets Groups Projects
Commit de52f073 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix potential use of invalid data.

parent 60a0aec5
No related branches found
No related tags found
No related merge requests found
......@@ -24,8 +24,11 @@ void show_stackframe()
char **messages = backtrace_symbols(trace, trace_size);
fprintf(stderr, "[bt] Execution path:\n");
for ( i = 0; i < trace_size; ++i ) fprintf(stderr, "[bt] %s\n", messages[i]);
if ( messages ) free(messages);
if ( messages ) {
for ( i = 0; i < trace_size; ++i )
fprintf(stderr, "[bt] %s\n", messages[i]);
free(messages);
}
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment