From ecd618cded21b2ad9d02c991e8f63b5137fe7b41 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 23 Sep 2022 17:14:44 +0200 Subject: [PATCH] Ensures no leakage of glyph_matrix ; * src/dispnew.c (allocate_matrices_for_window_redisplay): Ensures no leakage of glyph_matrix. --- src/dispnew.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index b786f0f1ba..9e4b43087e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1807,11 +1807,13 @@ allocate_matrices_for_window_redisplay (struct window *w) struct dim dim; /* If matrices are not yet allocated, allocate them now. */ + eassert ((w->desired_matrix == NULL) + && (w->current_matrix != NULL)); if (w->desired_matrix == NULL) - { - w->desired_matrix = new_glyph_matrix (NULL); - w->current_matrix = new_glyph_matrix (NULL); - } + w->desired_matrix = new_glyph_matrix (NULL); + + if (w->current_matrix == NULL) + w->current_matrix = new_glyph_matrix (NULL); dim.width = required_matrix_width (w); dim.height = required_matrix_height (w); -- 2.37.3