diff options
| author | Doug Gilmore | 2020-08-19 14:04:46 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-08-19 14:05:19 +0200 |
| commit | a7291a9fb979e117c3286d3cfa6d0d15557edace (patch) | |
| tree | b2ece34ef5f714dfe176fa2c5524bf174de645a5 /src | |
| parent | 1aacdf5aab09c7d0f7de648e55df7305ac1b87eb (diff) | |
| download | emacs-a7291a9fb979e117c3286d3cfa6d0d15557edace.tar.gz emacs-a7291a9fb979e117c3286d3cfa6d0d15557edace.zip | |
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).
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2a99c469276..2e0407aff40 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -9921,6 +9921,13 @@ x_uncatch_errors (void) | |||
| 9921 | { | 9921 | { |
| 9922 | struct x_error_message_stack *tmp; | 9922 | struct x_error_message_stack *tmp; |
| 9923 | 9923 | ||
| 9924 | /* In rare situations when running Emacs run in daemon mode, | ||
| 9925 | shutting down an emacsclient via delete-frame can cause | ||
| 9926 | x_uncatch_errors to be called when x_error_message is set to | ||
| 9927 | NULL. */ | ||
| 9928 | if (x_error_message == NULL) | ||
| 9929 | return; | ||
| 9930 | |||
| 9924 | block_input (); | 9931 | block_input (); |
| 9925 | 9932 | ||
| 9926 | /* The display may have been closed before this function is called. | 9933 | /* The display may have been closed before this function is called. |