Re: [RFA] Fix leak in linespec.c

Tom Tromey
2019-01-09T00:40:57Z

>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:

Simon> ... so you are adding the equivalent of the first cleanup.

Oops,sorry about that.

I hope eventually either we have ASAN and perhaps LSAN enabled in
development builds; or that it becomes a lot simpler to run tests under
valgrind... not trying to excuse my error, just trying to see how I
could prevent it next time.

Simon> It would be nice to be able to free the suffix strings in linespec_state_destructor, the
Simon> only problem is that we don't know the size of the canonical_names array at that point.

linespec would definitely benefit from a couple more rounds of C++-ification.
Some of the changes spill out into the rest of gdb though.

Tom