Subject: bug#58028: 29.0.50; Ensures no leakage of glyph_matrix

From: Eli Zaretskii <[email-masked]>
Date: Sat, 24 Sep 2022 15:31:07 +0300

> From: Manuel Giraud <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 24 Sep 2022 12:29:17 +0200
> 
> +	  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);

I think this should be

	  /* If matrices are not yet allocated, allocate them now.  */
	  if (w->desired_matrix == NULL)
	    {
	      w->desired_matrix = new_glyph_matrix (NULL);
	      eassert (w->current_matrix == NULL);
	    }

	  if (w->current_matrix == NULL)
	    w->current_matrix = new_glyph_matrix (NULL);