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

Tom Tromey tom@tromey.com
Tue Feb 26 22:02:00 GMT 2019


>>>>> "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



More information about the Gdb-patches mailing list