This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Apparent memory leak in PC/bdist_wininst/install.c
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Zachary.Blair, berker.peksag, steve.dower, vstinner, zach.ware
Priority: normal Keywords: patch

Created on 2010-08-02 20:45 by Zachary.Blair, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
install_c.diff Zachary.Blair, 2010-08-02 20:45 Patch that avoids the small memory leak
issue9456.diff berker.peksag, 2016-04-25 10:44 review
Messages (4)
msg112541 - (view) Author: Zachary Blair (Zachary.Blair) Date: 2010-08-02 20:45
From inspecting the code in install.c's DeleteRegistryValue() and DeleteRegistryKey() functions, it appears as though there can be a small memory leak in the event that either function is passed an invalid argument.

This patch corrects this issue by making sure to free any allocated memory before returning, even when an invalid argument is passed in.
msg220748 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-16 18:59
There is a simple patch to free memory which at a quick glance appears okay.  I've not tried to apply it as the line numbers tie up with those in the existing code.
msg264168 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-25 10:44
install_c.diff looks good to me. Attaching a fresh version of it. There is a comment in PC/bdist_wininst/install.c saying

    IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST BE REBUILT AS WELL.

I don't have Windows so I can't build VS project files myself. I'm adding Steve and Zachary to review/commit the patch (if they have time to take a look at it).
msg384820 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-01-11 12:51
The distutils bdist_wininst command has been removed in Python 3.10: see bpo-42802.
History
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53701
2021-01-11 12:51:28vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg384820

resolution: wont fix
stage: patch review -> resolved
2016-04-25 11:28:00BreamoreBoysetnosy: - BreamoreBoy
2016-04-25 10:44:37berker.peksagsetfiles: + issue9456.diff

type: behavior
versions: + Python 3.6, - Python 3.4
nosy: + berker.peksag, zach.ware, steve.dower

messages: + msg264168
stage: patch review
2014-06-16 18:59:19BreamoreBoysetnosy: + BreamoreBoy

messages: + msg220748
versions: + Python 2.7, Python 3.4, Python 3.5, - Python 3.1
2010-08-02 20:45:41Zachary.Blaircreate