[Bug driver/30640] Memory leak in lang_specific_driver

2024-03-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30640

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-03-25
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
Confirmed.

The following files which contain lang_specific_driver has the same issue:
c-family/cppspec.cc
c/gccspec.cc
cp/g++spec.cc
d/d-spec.cc
rust/rustspec.cc

fortran/gfortranspec.cc (it does not have a memory leak really though it keeps
around a pointer after its use though).
go/gospec.cc
m2/gm2spec.cc (similar to fortran)

[Bug driver/30640] Memory leak in lang_specific_driver

2012-02-22 Thread xiaoyuanbo at yeah dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30640

--- Comment #1 from xiaoyuanbo xiaoyuanbo at yeah dot net 2012-02-22 12:27:57 
UTC ---
(In reply to comment #0)
 in function lang_specific_driver, if shared gcclib is wanted, a new larger
 memory block is allocated for the extra argument -shared-libgcc. However, 
 the
 original memory is left alone and will cause memory leak. And I think 
 statement
 free(*in_argv) should added before *in_argv = arglist; at line 91, in file
 gcc-4.1.1\gcc\gccspec.c.

i understand arglist it is a block of memory 
if in a pointer anything to a block that define privilage to a very people in
the family
free(*in_argv)i understand destroy envrionemtn
then envrionment damage