diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-17 19:58:01 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-17 19:58:01 (GMT) |
commit | 095d99ffffbcee6d33523c439dc6a81a6787c5b6 (patch) | |
tree | 4d9fec15c49216e7ec70e4b6f77a3afa11d1ae6c /Objects/listobject.c | |
parent | 479054bca7722daa2e6b62da474fd49c8fafbbee (diff) | |
download | cpython-095d99ffffbcee6d33523c439dc6a81a6787c5b6.zip cpython-095d99ffffbcee6d33523c439dc6a81a6787c5b6.tar.gz cpython-095d99ffffbcee6d33523c439dc6a81a6787c5b6.tar.bz2 |
Issue #18408: Fix listpop(), handle list_ass_slice() failure
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 0ec70e5..ce6b708 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -934,12 +934,10 @@ listpop(PyListObject *self, PyObject *args) } Py_INCREF(v); status = list_ass_slice(self, i, i+1, (PyObject *)NULL); - assert(status >= 0); - /* Use status, so that in a release build compilers don't - * complain about the unused name. - */ - (void) status; - + if (status < 0) { + Py_DECREF(v); + return NULL; + } return v; } |