8000 Address code review. · python/cpython@d5f7d4b · GitHub
[go: up one dir, main page]

Skip to content

Commit d5f7d4b

Browse files
committed
Address code review.
1 parent db97dd2 commit d5f7d4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Modules/faulthandler.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)
0