diff --git a/Misc/NEWS.d/next/Library/2026-10-20-00-00-00.gh-issue-159739.5d4269.rst b/Misc/NEWS.d/next/Library/2026-10-20-00-00-00.gh-issue-159739.5d4269.rst new file mode 100644 index 000000000000000..94ee3cf4790112d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-10-20-00-00-00.gh-issue-159739.5d4269.rst @@ -0,0 +1 @@ +Fix a double free if remote unwinder initialization runs out of memory. diff --git a/Modules/_remote_debugging/module.c b/Modules/_remote_debugging/module.c index 6fa277d1065ed91..efb6d600247bf75 100644 --- a/Modules/_remote_debugging/module.c +++ b/Modules/_remote_debugging/module.c @@ -450,7 +450,6 @@ _remote_debugging_RemoteUnwinder___init___impl(RemoteUnwinderObject *self, NULL ); if (self->tlbc_cache == NULL) { - _Py_hashtable_destroy(self->code_object_cache); PyErr_NoMemory(); set_exception_cause(self, PyExc_MemoryError, "Failed to create TLBC cache"); return -1;