From a81c96c0348af8caf6ae45e2d942a676792a2a31 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 13 Oct 2024 11:17:48 +0200 Subject: Documentation and minor improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libparsepcf_destroy_preparsed_font.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libparsepcf_destroy_preparsed_font.c') diff --git a/libparsepcf_destroy_preparsed_font.c b/libparsepcf_destroy_preparsed_font.c index 36ec493..ded8cb7 100644 --- a/libparsepcf_destroy_preparsed_font.c +++ b/libparsepcf_destroy_preparsed_font.c @@ -5,6 +5,8 @@ void libparsepcf_destroy_preparsed_font(struct libparsepcf_font *font) { - free(font->_tables); - memset(font, 0, sizeof(*font)); + if (font) { + free(font->_tables); + *font = (struct libparsepcf_font){0}; + } } -- cgit v1.2.3-70-g09d2