Skip to content

Commit d0b01f8

Browse files
committed
gh-131591: Do not free page caches that weren't allocated
1 parent 5436289 commit d0b01f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/remote_debug.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ static void
154154
_Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
155155
{
156156
for (int i = 0; i < MAX_PAGES; i++) {
157-
PyMem_RawFree(handle->pages[i].data);
157+
if (handle->pages[i].data) {
158+
PyMem_RawFree(handle->pages[i].data);
159+
}
158160
handle->pages[i].data = NULL;
159161
handle->pages[i].valid = 0;
160162
}

0 commit comments

Comments
 (0)