Fix memory leak in an error condition

This commit is contained in:
Neal Norwitz 2007-08-12 17:09:36 +00:00
parent fca70054c5
commit cda5c068a4

View file

@ -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;