From 39ea4cdd7776bd4631290fe30b28f826154b4093 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 14 Aug 2024 10:13:27 -0700 Subject: [PATCH] [hb-subset] Fix a resource leak Part of https://github.com/harfbuzz/harfbuzz/issues/4832 --- util/hb-subset.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/hb-subset.cc b/util/hb-subset.cc index b65bf3154..fd0ffea4c 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -794,6 +794,7 @@ parse_file_for (const char *name, g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Failed reading file `%s': %s", arg, strerror (errno)); + fclose (fp); return false; } g_string_append_c (gs, '\0'); @@ -814,6 +815,8 @@ parse_file_for (const char *name, g_string_free (gs, false); + fclose (fp); + return true; }