File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,15 +235,12 @@ faulthandler_stack_dump_impl(int fd)
235235 size_t length = strlen (entry_str ) + 1 ;
236236 if (length == TRACEBACK_ENTRY_MAX_SIZE ) {
237237 /* We exceeded the size, make it look prettier */
238-
239238 // Add ellipsis to last 3 characters
240239 entry_str [TRACEBACK_ENTRY_MAX_SIZE - 5 ] = '.' ;
241240 entry_str [TRACEBACK_ENTRY_MAX_SIZE - 4 ] = '.' ;
242241 entry_str [TRACEBACK_ENTRY_MAX_SIZE - 3 ] = '.' ;
243-
244242 // Ensure trailing newline
245243 entry_str [TRACEBACK_ENTRY_MAX_SIZE - 2 ] = '\n' ;
246-
247244 // Ensure that it's null-terminated
248245 entry_str [TRACEBACK_ENTRY_MAX_SIZE - 1 ] = '\0' ;
249246 }
@@ -253,6 +250,8 @@ faulthandler_stack_dump_impl(int fd)
253250 if (frames == BACKTRACE_SIZE ) {
254251 PUTS (fd , " <truncated rest of calls>\n" );
255252 }
253+
254+ free (strings );
256255 }
257256#undef BACKTRACE_SIZE
258257#undef TRACEBACK_ENTRY_MAX_SIZE
You can’t perform that action at this time.
0 commit comments