From: Paul Eggert Date: Mon, 4 Oct 2021 03:11:57 +0000 (-0700) Subject: Tweak x_connection_closed when I/O error X-Git-Tag: emacs-28.0.90~422 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e1fb731393f0f47a910836915c410989c8d06a8f;p=emacs.git Tweak x_connection_closed when I/O error * src/xterm.c (x_connection_closed): Don’t dereference dpyinfo in the unlikely case where it is null and ioerror is true. This pacifies gcc 11.2.1 -Wanalyzer-null-dereference. --- diff --git a/src/xterm.c b/src/xterm.c index cf1e97a8b93..89885e0d889 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10133,8 +10133,9 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) frame on it. */ dpyinfo->reference_count++; dpyinfo->terminal->reference_count++; + if (ioerror) + dpyinfo->display = 0; } - if (ioerror) dpyinfo->display = 0; /* First delete frames whose mini-buffers are on frames that are on the dead display. */