mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-25 13:25:39 +02:00
font: allow font_destroy() to be called with a NULL pointer
This commit is contained in:
parent
8bc6a0b783
commit
770f2a0e7c
1 changed files with 3 additions and 0 deletions
3
font.c
3
font.c
|
@ -121,6 +121,9 @@ font_clone(const struct font *font)
|
||||||
void
|
void
|
||||||
font_destroy(struct font *font)
|
font_destroy(struct font *font)
|
||||||
{
|
{
|
||||||
|
if (font == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
cairo_scaled_font_destroy(font->scaled_font);
|
cairo_scaled_font_destroy(font->scaled_font);
|
||||||
free(font->name);
|
free(font->name);
|
||||||
free(font);
|
free(font);
|
||||||
|
|
Loading…
Add table
Reference in a new issue