mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Fix memory leak in an error condition
This commit is contained in:
parent
fca70054c5
commit
cda5c068a4
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue