Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-03 Thread Richard Biener via Gcc-patches
On Thu, Mar 2, 2023 at 3:02 PM Costas Argyris wrote: > > Thanks for the review. > > What is the next step please? Somebody pushed the patch already. Richard. > Thanks, > Costas > > On Thu, 2 Mar 2023 at 10:08, Richard Biener > wrote: >> >> On Thu, Mar 2, 2023 at 10:21 AM Costas Argyris >> w

Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-02 Thread Costas Argyris via Gcc-patches
Thanks for the review. What is the next step please? Thanks, Costas On Thu, 2 Mar 2023 at 10:08, Richard Biener wrote: > On Thu, Mar 2, 2023 at 10:21 AM Costas Argyris > wrote: > > > > I forgot to mention that: > > > > 1) The CreateProcess documentation > > > > > https://learn.microsoft.com/e

Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-02 Thread Richard Biener via Gcc-patches
On Thu, Mar 2, 2023 at 10:21 AM Costas Argyris wrote: > > I forgot to mention that: > > 1) The CreateProcess documentation > > https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa > > doesn't mention anything about taking ownership of this or an

Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-02 Thread Costas Argyris via Gcc-patches
I forgot to mention that: 1) The CreateProcess documentation https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa doesn't mention anything about taking ownership of this or any other buffer passed to it. 2) The cmdline buffer gets created by

Re: [PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-01 Thread Richard Biener via Gcc-patches
On Wed, Mar 1, 2023 at 7:14 PM Costas Argyris via Gcc-patches wrote: > > Hi > > It seems that the win32_spawn function in libiberty/pex-win32.c is leaking > the cmdline buffer in 2/3 exit scenarios (it is only free'd in 1/3).The > problem here is that the cleanup code is written 3 times, one a

[PATCH] libiberty: fix memory leak in pex-win32.c and refactor

2023-03-01 Thread Costas Argyris via Gcc-patches
emory leak in pex-win32.c and refactor Fix memory leak of cmdline buffer and refactor to have cleanup code appear once for all exit cases. --- libiberty/pex-win32.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/libiberty/pex-win32.c b/libibert