diff options
-rw-r--r-- | Modules/binascii.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c index 62beaea..c4c97b5 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -492,9 +492,13 @@ binascii_a2b_hqx(self, args) Py_DECREF(rv); return NULL; } - _PyString_Resize(&rv, (bin_data - (unsigned char *)PyString_AsString(rv))); - if ( rv ) - return Py_BuildValue("Oi", rv, done); + _PyString_Resize( + &rv, (bin_data - (unsigned char *)PyString_AsString(rv))); + if (rv) { + PyObject *rrv = Py_BuildValue("Oi", rv, done); + Py_DECREF(rv); + return rrv; + } return NULL; } |