diff options
author | Rob Austein <sra@hactrn.net> | 2012-09-12 00:23:18 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-09-12 00:23:18 +0000 |
commit | 0984fac73f335a22b46e1b02fac03e99c428275a (patch) | |
tree | 440e86b581d1369048fa8ac6ba7d3ce0ebb92409 | |
parent | 9c34563cd7feddf4f185fc543b66e3f7c6ec79ce (diff) |
Get reference counts right.
svn path=/branches/tk274/; revision=4709
-rw-r--r-- | rpkid/ext/POW.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/rpkid/ext/POW.c b/rpkid/ext/POW.c index 84571324..67bd5bae 100644 --- a/rpkid/ext/POW.c +++ b/rpkid/ext/POW.c @@ -1583,26 +1583,17 @@ x509_object_get_rfc3779(x509_object *self) } } - if (asn_result == NULL) { - Py_INCREF(Py_None); - asn_result = Py_None; - } - - if (ipv4_result == NULL) { - Py_INCREF(Py_None); - ipv4_result = Py_None; - } - - if (ipv6_result == NULL) { - Py_INCREF(Py_None); - ipv6_result = Py_None; - } - - result = Py_BuildValue("(OOO)", asn_result, ipv4_result, ipv6_result); + result = Py_BuildValue("(OOO)", + (asn_result == NULL ? Py_None : asn_result), + (ipv4_result == NULL ? Py_None : ipv4_result), + (ipv6_result == NULL ? Py_None : ipv6_result)); error: /* Fall through */ ASIdentifiers_free(asid); sk_IPAddressFamily_pop_free(addr, IPAddressFamily_free); + Py_XDECREF(range_b); + Py_XDECREF(range_e); + Py_XDECREF(range); Py_XDECREF(asn_result); Py_XDECREF(ipv4_result); Py_XDECREF(ipv6_result); |