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: fix memory leaks in posixmodule on Windows
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: mhammond Nosy List: mhammond, nnorwitz, tim.peters
Priority: normal Keywords: patch

Created on 2003-06-09 01:39 by nnorwitz, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
posix.diff nnorwitz, 2003-06-09 01:39 fix leaks 1
Messages (3)
msg43929 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-06-09 01:39
The attached patch should fix memory leaks from
os.listdir() on Windows.  I can't test this, but it
appears that bufptr was leaked in most circumstances.
msg43930 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-06-17 02:10
Logged In: YES 
user_id=31435

Reassigned to MarkH, since CVS annotate shows his name in 
this area more than anyone else's.

Offhand I don't see a reason to believe there's a leak here:  
looks like bufptr is non-NULL when PyArg_ParseTuple() is 
called, pointing to stack memory, and

"""
If *buffer points to a non-NULL pointer (an already allocated 
buffer), PyArg_ParseTuple() will use this location as buffer 
and interpret *buffer_length as buffer size. It will then copy 
the encoded data into the buffer and 0-terminate it. Buffer 
overflow is signalled with an exception. 
"""

If so, we certainly shouldn't try to free it!
msg43931 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2003-07-24 10:24
Logged In: YES 
user_id=14198

As Tim says, that is not a leak.  These semantics exist
exactly so this module did not have to take the penalty of
managing the memory in every single existing function that
wants to use "et"
History
Date User Action Args
2022-04-10 16:09:05adminsetgithub: 38611
2003-06-09 01:39:08nnorwitzcreate