]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak x_connection_closed when I/O error
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Oct 2021 03:11:57 +0000 (20:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Oct 2021 03:19:38 +0000 (20:19 -0700)
* 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.

src/xterm.c

index cf1e97a8b93d2417a3cb1f08845f9e0908caab7b..89885e0d88926934035b7add58e1c922eb3edcaf 100644 (file)
@@ -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.  */