Skip to content

Commit 3a728e5

Browse files
authored
gh-131591: Do not free page caches that weren't allocated (#143205)
1 parent 00e24b8 commit 3a728e5

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)