summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 000f6a2..d81674b 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -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;