From 986e224d5a71342b683975ea0240315a8264616b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 29 Oct 2013 03:14:22 +0100 Subject: [PATCH] Issue #18408: Fix error handling in PyBytes_FromObject() _PyBytes_Resize(&new) sets new to NULL on error, don't call Py_DECREF() with NULL. --- Objects/bytesobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 613269045b..529c634708 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; } -- 2.49.0