From eafec5836a3d41b23a4c190adc30a08896034b08 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 20 Feb 2025 14:11:51 +0100 Subject: [PATCH] glamor: don't need NULL check before free() free() is safe against NULL arguments. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- glamor/glamor_gradient.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c index 558e14311..7c22ccdb2 100644 --- a/glamor/glamor_gradient.c +++ b/glamor/glamor_gradient.c @@ -1110,10 +1110,8 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, } if (stops_count > RADIAL_SMALL_STOPS) { - if (n_stops) - free(n_stops); - if (stop_colors) - free(stop_colors); + free(n_stops); + free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS); @@ -1454,10 +1452,8 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, } if (stops_count > LINEAR_SMALL_STOPS) { - if (n_stops) - free(n_stops); - if (stop_colors) - free(stop_colors); + free(n_stops); + free(stop_colors); } glDisableVertexAttribArray(GLAMOR_VERTEX_POS);