From 922ae7eeed74d847778907602eb52e97cfb9f212 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 13 Jul 2013 17:21:01 +0300 Subject: [PATCH] Prevent leak in GDI objects (bug #14850). src/w32term.c (x_draw_hollow_cursor): Delete the brush object when returning early. --- src/ChangeLog | 3 +++ src/w32term.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4bd72f831cd..101672baa1e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2013-07-13 Eli Zaretskii + * w32term.c (x_draw_hollow_cursor): Delete the brush object when + returning early. (Bug#14850) + * coding.c (syms_of_coding): Set up inhibit-null-byte-detection and inhibit-iso-escape-detection attributes of 'undecided'. (Bug#14822) diff --git a/src/w32term.c b/src/w32term.c index c9951ca1d52..732a4f4bfef 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5174,7 +5174,10 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row) the current matrix is invalid or such, give up. */ cursor_glyph = get_phys_cursor_glyph (w); if (cursor_glyph == NULL) - return; + { + DeleteObject (hb); + return; + } /* Compute frame-relative coordinates for phys cursor. */ get_phys_cursor_geometry (w, row, cursor_glyph, &left, &top, &h); -- 2.11.4.GIT