]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix memory leak
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 12 Aug 2007 16:56:02 +0000 (16:56 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 12 Aug 2007 16:56:02 +0000 (16:56 +0000)
Modules/posixmodule.c

index d710a7366e449606d2c22e732353570c1cd07158..000f6a2ca3453b4e2faf7b65a98fe9bf27c5a99c 100644 (file)
@@ -4304,8 +4304,9 @@ posix_readlink(PyObject *self, PyObject *args)
        n = readlink(path, buf, (int) sizeof buf);
        Py_END_ALLOW_THREADS
        if (n < 0)
-               return posix_error_with_filename(path);
+               return posix_error_with_allocated_filename(path);
 
+       PyMem_Free(path);
        v = PyString_FromStringAndSize(buf, n);
        if (arg_is_unicode) {
                PyObject *w;