[hb-subset] Fix a resource leak

Part of https://github.com/harfbuzz/harfbuzz/issues/4832
This commit is contained in:
Behdad Esfahbod 2024-08-14 10:13:27 -07:00
parent e25fa0bff5
commit 39ea4cdd77

View file

@ -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;
}