glamor: don't need NULL check before free()

free() is safe against NULL arguments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1818>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-02-20 14:11:51 +01:00 committed by Marge Bot
parent e4e3b69626
commit eafec5836a

View File

@ -1110,9 +1110,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen,
} }
if (stops_count > RADIAL_SMALL_STOPS) { if (stops_count > RADIAL_SMALL_STOPS) {
if (n_stops)
free(n_stops); free(n_stops);
if (stop_colors)
free(stop_colors); free(stop_colors);
} }
@ -1454,9 +1452,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
} }
if (stops_count > LINEAR_SMALL_STOPS) { if (stops_count > LINEAR_SMALL_STOPS) {
if (n_stops)
free(n_stops); free(n_stops);
if (stop_colors)
free(stop_colors); free(stop_colors);
} }