diff mbox

[Ada] Fix minor memory leak in GNAT.Command_Line

Message ID 20160616102600.GA89477@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet June 16, 2016, 10:26 a.m. UTC
When a new switch is defined with a specific name for its parameter,
that name is not freed. This is a minor leak, since such switches
are in general defined once at the beginning of the program, and
never modified afterwards.
Detected with valgrind.

Tested on x86_64-pc-linux-gnu, committed on trunk

2016-06-16  Emmanuel Briot  <briot@adacore.com>

	* g-comlin.adb: Fix minor memory leak in GNAT.Command_Line.
diff mbox

Patch

Index: g-comlin.adb
===================================================================
--- g-comlin.adb	(revision 237429)
+++ g-comlin.adb	(working copy)
@@ -3073,6 +3073,7 @@ 
                Free (Config.Switches (S).Long_Switch);
                Free (Config.Switches (S).Help);
                Free (Config.Switches (S).Section);
+               Free (Config.Switches (S).Argument);
             end loop;
 
             Unchecked_Free (Config.Switches);