diff options
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 345d3b4..9032656 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -2809,6 +2809,8 @@ long_bitwise(PyLongObject *a, if (a->ob_size < 0) { a = (PyLongObject *) long_invert(a); + if (a == NULL) + return NULL; maska = MASK; } else { @@ -2817,6 +2819,10 @@ long_bitwise(PyLongObject *a, } if (b->ob_size < 0) { b = (PyLongObject *) long_invert(b); + if (b == NULL) { + Py_DECREF(a); + return NULL; + } maskb = MASK; } else { @@ -2868,7 +2874,7 @@ long_bitwise(PyLongObject *a, : (maskb ? size_a : MIN(size_a, size_b))) : MAX(size_a, size_b); z = _PyLong_New(size_z); - if (a == NULL || b == NULL || z == NULL) { + if (z == NULL) { Py_XDECREF(a); Py_XDECREF(b); Py_XDECREF(z); |