Fix leak involving BuildValue("...O...").

This commit is contained in:
Guido van Rossum 1997-01-12 20:02:04 +00:00
parent ebee0256f3
commit 9c6ba5e901
1 changed files with 7 additions and 3 deletions

View File

@ -492,9 +492,13 @@ binascii_a2b_hqx(self, args)
Py_DECREF(rv); Py_DECREF(rv);
return NULL; return NULL;
} }
_PyString_Resize(&rv, (bin_data - (unsigned char *)PyString_AsString(rv))); _PyString_Resize(
if ( rv ) &rv, (bin_data - (unsigned char *)PyString_AsString(rv)));
return Py_BuildValue("Oi", rv, done); if (rv) {
PyObject *rrv = Py_BuildValue("Oi", rv, done);
Py_DECREF(rv);
return rrv;
}
return NULL; return NULL;
} }