Fix a segfault in daemon mode Emacs when detaching an X session

* src/xterm.c (x_uncatch_errors): Add a sanity check for
x_error_message (bug#23939).
This commit is contained in:
Doug Gilmore 2020-08-19 14:04:46 +02:00 committed by Lars Ingebrigtsen
parent 1aacdf5aab
commit a7291a9fb9

View file

@ -9921,6 +9921,13 @@ x_uncatch_errors (void)
{
struct x_error_message_stack *tmp;
/* In rare situations when running Emacs run in daemon mode,
shutting down an emacsclient via delete-frame can cause
x_uncatch_errors to be called when x_error_message is set to
NULL. */
if (x_error_message == NULL)
return;
block_input ();
/* The display may have been closed before this function is called.