This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gas/read.c memory leak fix


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]