Issue #18408: Fix error handling in PyBytes_FromObject()

_PyBytes_Resize(&new) sets new to NULL on error, don't call Py_DECREF() with NULL.
This commit is contained in:
Victor Stinner 2013-10-29 03:14:22 +01:00
parent cc024d1820
commit 986e224d5a
1 changed files with 1 additions and 2 deletions

View File

@ -2660,9 +2660,8 @@ PyBytes_FromObject(PyObject *x)
return new; return new;
error: error:
/* Error handling when new != NULL */
Py_XDECREF(it); Py_XDECREF(it);
Py_DECREF(new); Py_XDECREF(new);
return NULL; return NULL;
} }