diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 17:09:36 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 17:09:36 (GMT) |
commit | cda5c068a460c29dab3a24abcfcc55a200ce77b3 (patch) | |
tree | 5d8c9f199aca5d48d7af10bcd89d50fd71abc0aa | |
parent | fca70054c5704535f38dd780821bb1482c01eb1e (diff) | |
download | cpython-cda5c068a460c29dab3a24abcfcc55a200ce77b3.zip cpython-cda5c068a460c29dab3a24abcfcc55a200ce77b3.tar.gz cpython-cda5c068a460c29dab3a24abcfcc55a200ce77b3.tar.bz2 |
Fix memory leak in an error condition
-rw-r--r-- | Modules/posixmodule.c | 5 |
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; |