This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] gas/read.c memory leak fix
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: Elias Athanasopoulos <eathan at otenet dot gr>
- Cc: binutils at sources dot redhat dot com
- Date: 12 Jun 2002 15:08:26 +0100
- Subject: Re: [PATCH] gas/read.c memory leak fix
- References: <20020611214424.F17527@neutrino.particles.org>
Hi Elias,
> I tested it, but I'm not quite sure if it is safe.
It's not. input_scrub_new_file() records the filename in
physical_input_file, and input_file_open records it in file_name. To
make the patch safe you would have to add xstrdup()s to both of these
and then arrange for the extra memory to be freed at the right time.
Cheers
Nick