Message144397
This patch seems reasonable. Upon looking at the code in more
detail, however, I can't see how the error condition that leaks the
reference can ever by triggered. In particular, the following code
from the 'PyCArrayType_from_ctype' function:
if (!PyType_Check(itemtype)) {
PyErr_SetString(PyExc_TypeError,
"Expected a type object");
return NULL;
}
'PyCArrayType_from_ctype' is only called from 'CDataType_repeat'. The
'CDataType_repeat' function is only used to implement the 'sq_repeat'
slot in 'CDataType_as_sequence'. 'CDataType_as_sequence' is used in all
of the implemented ctypes (struct, array, union, simple, ...).
Unless 'PyCArrayType_from_ctype' is called through some other means
(it is public), then 'itemtype' should *always* be a type. Or am
I missing something obvious? So, we could add the decref or just remove
the type check code all together (and make 'PyCArrayType_from_ctype'
private). |
|
Date |
User |
Action |
Args |
2011-09-22 02:30:46 | meador.inge | set | recipients:
+ meador.inge, amaury.forgeotdarc, belopolsky, Suman.Saha |
2011-09-22 02:30:46 | meador.inge | set | messageid: <1316658646.76.0.373991259566.issue13013@psf.upfronthosting.co.za> |
2011-09-22 02:30:46 | meador.inge | link | issue13013 messages |
2011-09-22 02:30:45 | meador.inge | create | |
|