[issue9191] winreg.c:Reg2Py() may leak memory (in unusual circumstances)
Claudiu Popa added the comment: This was fixed a couple of months ago: https://hg.python.org/cpython/rev/07968254be96. Also, malloc was changed to PyMem_New a couple of weeks ago: https://hg.python.org/cpython/rev/036a2aceae93 -- nosy: +Claudiu.Popa resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9191 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9191] winreg.c:Reg2Py() may leak memory (in unusual circumstances)
Mark Lawrence added the comment: Can somebody answer the question about PyMem versus malloc/free functions. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9191 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9191] winreg.c:Reg2Py() may leak memory (in unusual circumstances)
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9191 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9191] winreg.c:Reg2Py() may leak memory (in unusual circumstances)
New submission from Daniel Stutzbach dan...@stutzbachenterprises.com: In Reg2Py() in winreg.c, in the REG_MULTI_SZ case, there's the following: wchar_t **str = (wchar_t **)malloc(sizeof(wchar_t *)*s); if (str == NULL) return PyErr_NoMemory(); However, not all of the return paths after that point call free(str). The leaking paths are pretty unusual, so I'm setting the priority to low. The leaking paths occur when PyList_New returns NULL or if the registry entry contains more than INT_MAX characters. Two other things I noticed and I'm not sure about: Is INT_MAX really the maximum number of characters for a Python unicode string? Should this be using PyMem functions instead of malloc/free? -- assignee: stutzbach components: Windows messages: 109486 nosy: stutzbach priority: low severity: normal stage: needs patch status: open title: winreg.c:Reg2Py() may leak memory (in unusual circumstances) type: resource usage versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9191 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9191] winreg.c:Reg2Py() may leak memory (in unusual circumstances)
Changes by Brian Curtin cur...@acm.org: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9191 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com