[Ada] Fix memory leak in GNAT.Expect.Non_Blocking_Spawn on Windows

gcc/ada/

	* libgnat/g-expect.adb (Non_Blocking_Spawn): Deallocate elements
	on Arg_List after calling Set_Up_Child_Communications.
This commit is contained in:
Dmitriy Anisimkov 2020-11-29 23:21:58 +06:00 committed by Pierre-Marie de Rodat
parent 64f4351d83
commit 29cd42e019

View file

@ -1181,6 +1181,12 @@ package body GNAT.Expect is
Set_Up_Child_Communications
(Descriptor, Pipe1, Pipe2, Pipe3, Command_With_Path.all,
C_Arg_List'Address);
-- On Windows systems we need to release memory taken for Arg_List
for A of Arg_List loop
Free (A);
end loop;
end if;
Free (Command_With_Path);