diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-12-21 11:31:54 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-12-21 11:31:54 (GMT) |
commit | ed02b3f34272e26417aca3445b9cdb3fd63a8dab (patch) | |
tree | 6f475af9c1c814b1e643344d0b543a25411e2717 | |
parent | e31d300664f54029ce35ccb78475333b968fdd6b (diff) | |
download | cpython-ed02b3f34272e26417aca3445b9cdb3fd63a8dab.zip cpython-ed02b3f34272e26417aca3445b9cdb3fd63a8dab.tar.gz cpython-ed02b3f34272e26417aca3445b9cdb3fd63a8dab.tar.bz2 |
Fix reference counts for test_long_and_overflow.
-rw-r--r-- | Modules/_testcapimodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 2bcf754..bc03940 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -388,6 +388,8 @@ test_long_and_overflow(PyObject *self) return raiseTestError("test_long_and_overflow", "overflow was not set to 0"); + Py_DECREF(num); + /* a number smaller than LONG_MIN even on 64-bit platforms */ num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16); if (num == NULL) @@ -406,6 +408,8 @@ test_long_and_overflow(PyObject *self) return raiseTestError("test_long_and_overflow", "overflow was not set to 0"); + Py_DECREF(num); + num = PyLong_FromString("FF", NULL, 16); if (num == NULL) return NULL; @@ -423,6 +427,8 @@ test_long_and_overflow(PyObject *self) return raiseTestError("test_long_and_overflow", "overflow was set incorrectly"); + Py_DECREF(num); + Py_INCREF(Py_None); return Py_None; } |