diff options
author | Guido van Rossum <guido@python.org> | 1997-01-12 20:02:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-01-12 20:02:04 (GMT) |
commit | 9c6ba5e901026225b11648ce11ba9d8305286113 (patch) | |
tree | 5bb99bec1df7c261cfc44769035b69c695031a32 /Modules/binascii.c | |
parent | ebee0256f35d9d450f718de0eaf49f0bfc6ae1bc (diff) | |
download | cpython-9c6ba5e901026225b11648ce11ba9d8305286113.zip cpython-9c6ba5e901026225b11648ce11ba9d8305286113.tar.gz cpython-9c6ba5e901026225b11648ce11ba9d8305286113.tar.bz2 |
Fix leak involving BuildValue("...O...").
Diffstat (limited to 'Modules/binascii.c')
-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; } |