[PATCH] gdbserver: add client_state destructor

Pedro Alves pedro@palves.net
Fri May 3 16:14:20 GMT 2024


On 2024-05-03 16:17, Tom Tromey wrote:
>>> At some point we went through the tree and removed all these IIRC.
> 
> Guinevere> I think I have a case of friday brains. You mean removed all nullptr
> Guinevere> checks, or removed unnecessary xfrees?
> 
> Sorry.  All the checks of null before free were removed at some point.
> 
> Though I see that gdb-xfree.h still does the check.  Lol.
> IIRC, the gnulib folks looked into this and concluded that no existing
> system requires the check before a call to free.

That is the original point of xfree existing.  It was needed on some ancient
Solaris, IIRC.  It's free didn't work right with a null argument.

Note that bfd uses xmalloc, but does not use xfree, so all such hosts are surely
gone.

Nowadays, having xfree is still important for the POD checking, of course,
and it's nice to have xmalloc/xfree for balance IMHO, thought that's of course
debatable.



More information about the Gdb-patches mailing list