gh-131591: Do not free page caches that weren't allocated (#143205)

This commit is contained in:
Pablo Galindo Salgado 2025-12-27 13:38:11 +00:00 committed by GitHub
parent 00e24b80e0
commit 3a728e5f93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -154,7 +154,9 @@ static void
_Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
{
for (int i = 0; i < MAX_PAGES; i++) {
PyMem_RawFree(handle->pages[i].data);
if (handle->pages[i].data) {
PyMem_RawFree(handle->pages[i].data);
}
handle->pages[i].data = NULL;
handle->pages[i].valid = 0;
}