Message333499
Hi.
I think I have found a minor memory leak in Modules/main.c:pymain_parse_cmdline_impl.
When the loop in the pymain_read_conf function in this same file
calls pymain_init_cmdline_argv a 2nd time, the pymain->command
buffer of wchar_t is overriden and the previously allocated memory
is never freed.
I haven't written any code test to reproduce this,
but it can be tested easily with gdb:
```
gdb -- bin/python3 -c pass
start
b Modules/main.c:587
b pymain_clear_pymain
c
c
```
You'll see that PyMem_RawMalloc is called twice without pymain->command ever being freed in pymain_clear_pymain.
I have a patch coming as PR on GitHub
I'd be glad to have your feedback on this issue and my proposal for a fix.
Regards. |
|
Date |
User |
Action |
Args |
2019-01-11 19:14:05 | Lucas Cimon | set | recipients:
+ Lucas Cimon |
2019-01-11 19:14:02 | Lucas Cimon | set | messageid: <1547234042.68.0.95184796304.issue35720@roundup.psfhosted.org> |
2019-01-11 19:14:02 | Lucas Cimon | link | issue35720 messages |
2019-01-11 19:14:02 | Lucas Cimon | create | |
|