Fix leak involving BuildValue("...O...").
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 @@
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;
}