07-08-06 06:12 AM
On first look I would agree there is possibly a problem. There also
would appear to be
similar issues in other parts of mod_python. For example in
cfgtree_walk() of util.c it has:
PyObject *t = Py_BuildValue("(s, s)", dir->directive, dir-
>args);
if (!t)
return PyErr_NoMemory();
PyList_Append(list, t);
with "t" not being DECREF'd either.
Also, in req_readlines() of requestobject.c, we have:
line = req_readline(self, rlargs);
while (line && (PyString_Size(line)>0)) {
PyList_Append(result, line);
size += PyString_Size(line);
if ((sizehint != -1) && (size >= size))
break;
line = req_readline(self, args);
}
No DECREF for item added to list.
I can't see any others in relation to dictionaries yet, but we
probably need to do a good
audit of all the code for such things as I have only check
PyList_Append() and
PyDict_SetItem() and not the other ways stuff can be added to such
data structures.
Anyway, still need to run some tests yet to confirm memory leak. :-)
Graham
On 08/07/2006, at 1:05 AM, Harold Ship (JIRA) wrote:
> [ http://issues.apache.org/jira/browse/MODPYTHON-172?
> page=comments#action_12419728 ]
>
> Harold Ship commented on MODPYTHON-172:
> ---------------------------------------
>
> Please look at lines 202-205 of the same file, in parse_qs() :
>
> PyObject *list;
> list = Py_BuildValue("[O]", val);
> PyDict_SetItem(dict, key, list);
> Py_DECREF(list);
>
>
>
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the
> administrators:
> http://issues.apache.org/jira/secur...nistrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
[ Post a follow-up to this message ]
|