commit c15e6366cb40046802c102cce987a70409fc9be6
parent ee69a647693f983ce1796a0c0332c3c33b11c0a8
Author: nibo <nibo@relim.de>
Date: Sat, 12 Oct 2024 21:08:10 +0200
Fix problem with invalid free()
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/chordpro.c b/chordpro.c
@@ -1473,7 +1473,9 @@ cho_metadata_free(struct ChoMetadata *meta)
{
free(meta->name);
free(meta->value);
- cho_style_free(meta->style);
+ if (meta->style) {
+ cho_style_free(meta->style);
+ }
free(meta);
}
diff --git a/chordpro.h b/chordpro.h
@@ -18,7 +18,6 @@ enum EnvironmentDirective {
START_OF_BRIDGE, SOB, END_OF_BRIDGE, EOB,
START_OF_TAB, SOT, END_OF_TAB, EOT,
START_OF_GRID, SOG, END_OF_GRID, EOG
-
};
enum FormattingDirective {