emacs-diffs
[Top][All Lists]
Advanced

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

master d52749202f: Fix use-after-free in x_destroy_window


From: Po Lu
Subject: master d52749202f: Fix use-after-free in x_destroy_window
Date: Sun, 22 May 2022 01:13:16 -0400 (EDT)

branch: master
commit d52749202f690a50f832c25ddd80929d175e67b4
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix use-after-free in x_destroy_window
    
    * src/xterm.c (x_destroy_window): Fix use after free of the
    dpyinfo.
---
 src/xterm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index 5c2deb62e0..0487259bf0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -23397,7 +23397,6 @@ x_destroy_window (struct frame *f)
     x_free_frame_resources (f);
 
   xfree (f->output_data.x->saved_menu_event);
-  xfree (f->output_data.x);
 
 #ifdef HAVE_X_I18N
   if (f->output_data.x->preedit_chars)
@@ -23409,6 +23408,7 @@ x_destroy_window (struct frame *f)
     XFree (f->output_data.x->xi_masks);
 #endif
 
+  xfree (f->output_data.x);
   f->output_data.x = NULL;
 
   dpyinfo->reference_count--;



reply via email to

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