New GitHub issue #119128 from AraHaan:<br>

<hr>

<pre>
# Crash report

### What happened?

When I was debugging my C extension I eventually found a way to get it to work using the interactive debug version of the interpreter and using ``_PyObject_Dump`` to also check the reference counts of everything to ensure my extension module works properly and has proper reference counting.

However when I typed in ``exit()`` to close the interpreter I crashed in ``_PyFrame_Clear`` within the for loop as it fails to check first if ``frame->localsplus`` is not ``NULL`` before attempting to index into it resulting in an Access Violation.

This *should* be a trivial patch. Issue is how come ``frame->localsplus`` is ``NULL`` to begin with?

### CPython versions tested on:

3.11, 3.12, CPython main branch

### Operating systems tested on:

Windows

### Output from running 'python -VV' on the command line:

python_d.exe -X dev (no script file for interactive console mode)
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/119128">View on GitHub</a>
<p>Labels: type-crash</p>
<p>Assignee: </p>