aboutsummaryrefslogtreecommitdiff
path: root/rpkid
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-09-20 18:38:14 +0000
committerRob Austein <sra@hactrn.net>2013-09-20 18:38:14 +0000
commit8ecdcede3cf6d07404a2cd6792504a5eb68cdf8a (patch)
tree58b59fe478ca04dd04ba0b7d8e756f7cf36ce2e4 /rpkid
parent79af82a18c0f9254b52623eba4ebaf766740da0b (diff)
Fix obscure reference count oops in IPAddress arithmetic operation
coercion code. svn path=/trunk/; revision=5505
Diffstat (limited to 'rpkid')
-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);
}