Commit cda5c068 authored by Neal Norwitz's avatar Neal Norwitz

Fix memory leak in an error condition

parent fca70054
......@@ -4293,7 +4293,10 @@ posix_readlink(PyObject *self, PyObject *args)
Py_FileSystemDefaultEncoding, &path))
return NULL;
v = PySequence_GetItem(args, 0);
if (v == NULL) return NULL;
if (v == NULL) {
PyMem_Free(path);
return NULL;
}
if (PyUnicode_Check(v)) {
arg_is_unicode = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment