Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-211

Potential memory leak in req.readlines().

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.x, 3.2.10
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grahamd Graham Phillip Dumpleton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: