Re: [RFC] Fix BFD leak in solib-darwin.c

Tom Tromey
2019-02-26T22:02:32Z

>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

John> I think the warning would be useful if it doesn't trigger a lot of false
John> positives. I feel like it wouldn't today. When I was grep'ing for
John> 'release ()' I only focused on the calls that weren't assigning a value
John> to a result and I feel like there weren't many of those (and some were
John> assigning, just not obvious in the one line of grep context).

Yeah. I went ahead and did this... I had to fix up a few spots, nothing
too terrible. It caught one bug, in varobj.c:

if (pretty_printer == Py_None)
pretty_printer.release ();

install_visualizer (var->dynamic, NULL, pretty_printer.release ());

I think that first release should be .reset(nullptr) instead.

I'll send it through the buildbot and see what happens there.

Tom