@@ -16,7 +16,7 @@ static PyObject *
1616binascii_a2b_uu (PyModuleDef * module , PyObject * args )
1717{
1818 PyObject * return_value = NULL ;
19- Py_buffer data ;
19+ Py_buffer data = { NULL , NULL } ;
2020
2121 if (!PyArg_ParseTuple (args ,
2222 "O&:a2b_uu" ,
@@ -25,6 +25,10 @@ binascii_a2b_uu(PyModuleDef *module, PyObject *args)
2525 return_value = binascii_a2b_uu_impl (module , & data );
2626
2727exit :
28+ /* Cleanup for data */
29+ if (data .obj )
30+ PyBuffer_Release (& data );
31+
2832 return return_value ;
2933}
3034
@@ -72,7 +76,7 @@ static PyObject *
7276binascii_a2b_base64 (PyModuleDef * module , PyObject * args )
7377{
7478 PyObject * return_value = NULL ;
75- Py_buffer data ;
79+ Py_buffer data = { NULL , NULL } ;
7680
7781 if (!PyArg_ParseTuple (args ,
7882 "O&:a2b_base64" ,
@@ -81,6 +85,10 @@ binascii_a2b_base64(PyModuleDef *module, PyObject *args)
8185 return_value = binascii_a2b_base64_impl (module , & data );
8286
8387exit :
88+ /* Cleanup for data */
89+ if (data .obj )
90+ PyBuffer_Release (& data );
91+
8492 return return_value ;
8593}
8694
@@ -128,7 +136,7 @@ static PyObject *
128136binascii_a2b_hqx (PyModuleDef * module , PyObject * args )
129137{
130138 PyObject * return_value = NULL ;
131- Py_buffer data ;
139+ Py_buffer data = { NULL , NULL } ;
132140
133141 if (!PyArg_ParseTuple (args ,
134142 "O&:a2b_hqx" ,
@@ -137,6 +145,10 @@ binascii_a2b_hqx(PyModuleDef *module, PyObject *args)
137145 return_value = binascii_a2b_hqx_impl (module , & data );
138146
139147exit :
148+ /* Cleanup for data */
149+ if (data .obj )
150+ PyBuffer_Release (& data );
151+
140152 return return_value ;
141153}
142154
@@ -350,7 +362,7 @@ static PyObject *
350362binascii_a2b_hex (PyModuleDef * module , PyObject * args )
351363{
352364 PyObject * return_value = NULL ;
353- Py_buffer hexstr ;
365+ Py_buffer hexstr = { NULL , NULL } ;
354366
355367 if (!PyArg_ParseTuple (args ,
356368 "O&:a2b_hex" ,
@@ -359,6 +371,10 @@ binascii_a2b_hex(PyModuleDef *module, PyObject *args)
359371 return_value = binascii_a2b_hex_impl (module , & hexstr );
360372
361373exit :
374+ /* Cleanup for hexstr */
375+ if (hexstr .obj )
376+ PyBuffer_Release (& hexstr );
377+
362378 return return_value ;
363379}
364380
@@ -377,7 +393,7 @@ binascii_a2b_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
377393{
378394 PyObject * return_value = NULL ;
379395 static char * _keywords [] = {"data" , "header" , NULL };
380- Py_buffer data ;
396+ Py_buffer data = { NULL , NULL } ;
381397 int header = 0 ;
382398
383399 if (!PyArg_ParseTupleAndKeywords (args , kwargs ,
@@ -387,6 +403,10 @@ binascii_a2b_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
387403 return_value = binascii_a2b_qp_impl (module , & data , header );
388404
389405exit :
406+ /* Cleanup for data */
407+ if (data .obj )
408+ PyBuffer_Release (& data );
409+
390410 return return_value ;
391411}
392412
@@ -427,4 +447,4 @@ binascii_b2a_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
427447
428448 return return_value ;
429449}
430- /*[clinic end generated code: checksum=abe48ca8020fa3ec25e13bd9fa7414f6b3ee2946 ]*/
450+ /*[clinic end generated code: checksum=8180e5be47a110ae8c89263a7c12a91d80754f60 ]*/
0 commit comments