From b2f485d9dfe25c2006fe2a1ace9a7ed1a9a9162f Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sun, 24 Nov 2024 13:55:54 +1300 Subject: Fixed double free in Finalize subprograms --- src/fltk-environment.adb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fltk-environment.adb') diff --git a/src/fltk-environment.adb b/src/fltk-environment.adb index 4cafb19..1632717 100644 --- a/src/fltk-environment.adb +++ b/src/fltk-environment.adb @@ -400,6 +400,7 @@ package body FLTK.Environment is begin if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then free_fl_pref_database (This.Void_Ptr); + This.Void_Ptr := Null_Pointer; end if; end Finalize; @@ -409,6 +410,7 @@ package body FLTK.Environment is begin if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then free_fl_pref_group (This.Void_Ptr); + This.Void_Ptr := Null_Pointer; if This.Root_Ptr /= Null_Pointer then free_fl_pref_database (This.Root_Ptr); end if; -- cgit