summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-10-29 02:14:22 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-10-29 02:14:22 (GMT)
commit986e224d5a71342b683975ea0240315a8264616b (patch)
tree6854c55bef2a80e7906be23db4264ffcc271678a /Objects
parentcc024d18207f9967c707186eec77731a6c1eea35 (diff)
downloadcpython-986e224d5a71342b683975ea0240315a8264616b.zip
cpython-986e224d5a71342b683975ea0240315a8264616b.tar.gz
cpython-986e224d5a71342b683975ea0240315a8264616b.tar.bz2
Issue #18408: Fix error handling in PyBytes_FromObject()
_PyBytes_Resize(&new) sets new to NULL on error, don't call Py_DECREF() with NULL.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 6132690..529c6347 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2660,9 +2660,8 @@ PyBytes_FromObject(PyObject *x)
return new;
error:
- /* Error handling when new != NULL */
Py_XDECREF(it);
- Py_DECREF(new);
+ Py_XDECREF(new);
return NULL;
}