Apache Mod-Python - Created: (MODPYTHON-211) Potential memory leak in

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > January 2007 > Created: (MODPYTHON-211) Potential memory leak in





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Created: (MODPYTHON-211) Potential memory leak in
Graham Dumpleton (JIRA)

2007-01-14, 1:13 am

Potential memory leak in req.readlines().
-----------------------------------------

Key: MODPYTHON-211
URL: https://issues.apache.org/jira/browse/MODPYTHON-211
Project: mod_python
Issue Type: Bug
Components: core
Affects Versions: 3.2.10, 3.3
Reporter: Graham Dumpleton


This code in req.readlines() looks a bit fishy to me and possibly leaks memory. The code in question is:

rlargs = PyTuple_New(0);
if (result == NULL)
return PyErr_NoMemory();

line = req_readline(self, rlargs);
while (line && ((linesize=PyString_Size(line))>0)) {
PyList_Append(result, line);
size += linesize;
if ((sizehint != -1) && (size >= sizehint))
break;
Py_DECREF(line);
line = req_readline(self, args);
}
Py_XDECREF(line);

The thing that looks wrong is 'rlargs'. This is created, used in a sub call to req_readline() but then never destroyed. Thus, possibly a memory leak.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com