aboutsummaryrefslogtreecommitdiff
path: root/rpkid/ext/POW.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/ext/POW.c')
-rw-r--r--rpkid/ext/POW.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpkid/ext/POW.c b/rpkid/ext/POW.c
index b4018802..de675718 100644
--- a/rpkid/ext/POW.c
+++ b/rpkid/ext/POW.c
@@ -1276,6 +1276,7 @@ ipaddress_object_number_binary_helper(binaryfunc function, PyObject *arg1, PyObj
(obj1 = PyNumber_Long(arg1)) == NULL ||
(obj2 = PyNumber_Long(arg2)) == NULL) {
result = (ipaddress_object *) Py_NotImplemented;
+ Py_INCREF(result);
goto error;
}
@@ -1314,7 +1315,7 @@ ipaddress_object_number_long(PyObject *arg)
ENTERING(ipaddress_object_number_long);
if (!POW_IPAddress_Check(arg))
- return Py_NotImplemented;
+ return Py_INCREF(Py_NotImplemented), Py_NotImplemented;
return _PyLong_FromByteArray(addr->address, addr->type->length, 0, 0);
}