Skip to content

Commit c62f9fe

Browse files
authored
Merge pull request #27958 from charris/backport-27955
BUG: fix use-after-free error in npy_hashtable.cpp (#27955)
2 parents bc0030d + c3faf14 commit c62f9fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/_core/src/common/npy_hashtable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ NPY_NO_EXPORT void
126126
PyArrayIdentityHash_Dealloc(PyArrayIdentityHash *tb)
127127
{
128128
PyMem_Free(tb->buckets);
129-
PyMem_Free(tb);
130129
#ifdef Py_GIL_DISABLED
131130
delete (std::shared_mutex *)tb->mutex;
132131
#endif
132+
PyMem_Free(tb);
133133
}
134134

135135

0 commit comments

Comments
 (0)