emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 e1fb7313: Tweak x_connection_closed when I/O error


From: Paul Eggert
Subject: emacs-28 e1fb7313: Tweak x_connection_closed when I/O error
Date: Sun, 3 Oct 2021 23:19:43 -0400 (EDT)

branch: emacs-28
commit e1fb731393f0f47a910836915c410989c8d06a8f
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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.
---
 src/xterm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index cf1e97a..89885e0 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.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]