[PATCH] Fix libcpp memory leak (PR middle-end/56461)

Tom Tromey tromey@redhat.com
Wed Mar 6 16:12:00 GMT 2013

>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

Jakub> 2013-02-28  Jakub Jelinek  <jakub@redhat.com>
Jakub> 	PR middle-end/56461
Jakub> 	* internal.h (struct cpp_buffer): Add to_free field.
Jakub> 	(_cpp_pop_file_buffer): Add third argument.
Jakub> 	* files.c (_cpp_stack_file): Set buffer->to_free.
Jakub> 	(_cpp_pop_file_buffer): Add to_free argument.  Free to_free
Jakub> 	if non-NULL, and if equal to file->buffer_start, also clear
Jakub>  file-> buffer{,_start,_valid}.
Jakub> 	* directives.c (_cpp_pop_buffer): Pass buffer->to_free
Jakub> 	to _cpp_pop_file_buffer.

This is ok.  Thanks, Jakub.


More information about the Gcc-patches mailing list