From 3e5badfaa1c7b0d21fca35973b7ebe7e2758ed7afd8c7a2e60025c6a5a36940c Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sun, 17 Aug 2025 02:45:15 -0400 Subject: [PATCH] Fix a use-after-free. --- dw/fltkplatform.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index f0ac7b5..ef182a6 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -157,7 +157,6 @@ void FltkFont::initSystemFonts () _MSG("Found font: %s%s%s\n", name, t & FL_BOLD ? " bold" : "", t & FL_ITALIC ? " italic" : ""); - free (name); auto &family = (*systemFonts)[ name ]; if( family ) { @@ -168,6 +167,8 @@ void FltkFont::initSystemFonts () family = std::make_unique< FontFamily >( (Fl_Font) i, -1, -1, -1 ); family->set( (Fl_Font) i, t ); } + + free (name); } }