[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset d9c6564f90ead067c2e288f01825684821b7a129 by Victor Stinner (stratakis) in branch '2.7': [2.7] bpo-18368: Fix memory leaks in PyOS_StdioReadline() when realloc() fails (GH-12334)

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2019-03-14 Thread Charalampos Stratakis
Change by Charalampos Stratakis : -- pull_requests: +12305 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-08-16 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18368 ___ ___

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch can be a little simplified (the else keyword is redundant), but in general it LGTM. Let's push. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18368

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-08-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5859a3ec5b7e by Christian Heimes in branch '3.3': Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc() fails. http://hg.python.org/cpython/rev/5859a3ec5b7e New changeset 6dbc4d6ff31e by Christian Heimes in branch 'default':

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-08-06 Thread Christian Heimes
Christian Heimes added the comment: Serhiy: Thanks for the review Kristján: Yes, it's enough to check for incr INT_MAX. The buffer size is incremented to a value of = (2*n)+2 in each round. The start value is 100. The loop is terminated once the buffer size reaches INT_MAX-2. --

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-07-12 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18368 ___ ___ Python-bugs-list

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: A similar issue: #14909. -- nosy: +kristjan.jonsson, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18368 ___

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-07-12 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Is it sufficient to check incr INT_MAX to guard against overflow? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18368 ___

[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2013-07-05 Thread Christian Heimes
New submission from Christian Heimes: PyOS_StdioReadline() contains code such as: p = (char *)PyMem_REALLOC(p, n + incr); The code looses its pointer to p when realloc fails and has no chance to free the memory in p. Also the code sets PyExc_OverflowError when incr INT_MAX but it doesn't