aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpkid/ext/POW.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpkid/ext/POW.c b/rpkid/ext/POW.c
index 231b5802..32526fdd 100644
--- a/rpkid/ext/POW.c
+++ b/rpkid/ext/POW.c
@@ -1160,9 +1160,11 @@ ipaddress_object_from_bytes(PyTypeObject *type, PyObject *args)
lose("Unknown IP version number");
memcpy(result->address, bytes, len);
+ return (PyObject *) result;
error:
- return (PyObject *) result;
+ Py_XDECREF(result);
+ return NULL;
}
static char ipaddress_object_to_bytes__doc__[] =