Skip to content

Commit e130a07

Browse files
btharpervstinner
authored andcommitted
bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)
_PyPreConfig_Read() now free 'old_old' at exit.
1 parent 5f1e8b4 commit e130a07

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix leaks that led to build failure when configured with address sanitizer.

Python/preconfig.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ _PyPreConfig_Read(_PyPreConfig *config)
514514
err = preconfig_read(config, NULL);
515515

516516
setlocale(LC_CTYPE, old_loc);
517+
PyMem_RawFree(old_loc);
517518

518519
return err;
519520
}

0 commit comments

Comments
 (0)