From: Pablo Galindo Salgado Date: Sat, 27 Dec 2025 13:38:11 +0000 (+0000) Subject: gh-131591: Do not free page caches that weren't allocated (#143205) X-Git-Tag: v3.15.0a5~11^2~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a728e5f93c1e4c125406eeeb76d5df1c1726409;p=thirdparty%2FPython%2Fcpython.git gh-131591: Do not free page caches that weren't allocated (#143205) --- diff --git a/Python/remote_debug.h b/Python/remote_debug.h index d9c5c480fe9a..dba6da3bad41 100644 --- a/Python/remote_debug.h +++ b/Python/remote_debug.h @@ -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; }