[PATCH v2] libiberty(argv.c): Fix memory leak in expandargv.

2021-02-18 Thread Ayush Mittal via Gcc-patches
libiberty/ChangeLog: * argv.c (expandargv): free allocated buffer if read fails. Signed-off-by: Ayush Mittal Signed-off-by: Maninder Singh --- v1 -> v2: corrected formatting and changelog commit libiberty/argv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l

[PATCH 1/1] libiberty(argv.c): Fix memory leak in expandargv.

2021-02-18 Thread Ayush Mittal via Gcc-patches
Dynamic memory referenced by 'buffer' was allocated using xmalloc but fails to free it when jump to 'error' label. Issue as per static analysis tool. Signed-off-by: Ayush Mittal Signed-off-by: Maninder Singh --- libiberty/ChangeLog | 4 libiberty/argv.c| 5 - 2 files changed, 8 i