We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6a4bc8 commit 5a4c1d6Copy full SHA for 5a4c1d6
Modules/_ctypes/_ctypes.c
@@ -3117,8 +3117,11 @@ static int
3117
PyCData_MallocBuffer(CDataObject *obj, StgInfo *info)
3118
{
3119
/* We don't have to lock in this function, because it's only
3120
- used in constructors and therefore does not have concurrent
3121
- access. */
+ * used in constructors and therefore does not have concurrent
+ * access.
3122
+ */
3123
+ assert (Py_REFCNT(obj) == 1);
3124
+
3125
if ((size_t)info->size <= sizeof(obj->b_value)) {
3126
/* No need to call malloc, can use the default buffer */
3127
obj->b_ptr = (char *)&obj->b_value;
0 commit comments