Skip to content

Commit 11a0d97

Browse files
committed
Fix NULL ptr in _memory_release
1 parent d359a76 commit 11a0d97

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/memoryobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,10 @@ PyBuffer_ToContiguous(void *buf, const Py_buffer *src, Py_ssize_t len, char orde
11021102
static int
11031103
_memory_release(PyMemoryViewObject *self)
11041104
{
1105+
/* this could be NULL if there is a PickleBuffer in cyclic references */
1106+
if(self->mbuf == NULL)
1107+
return 0;
1108+
11051109
if (self->flags & _Py_MEMORYVIEW_RELEASED)
11061110
return 0;
11071111

0 commit comments

Comments
 (0)