GDB does not use the function free . GDB uses the function xfree to return memory to the memory pool. Consistent with ISO-C, this function ignores a request to free a NULL pointer. On some systems free fails when passed a NULL pointer. This function is very non-portable.
Some systems restrict the memory being allocated to no more than a few kilobytes.
GDB uses the string function xstrdup and the print function xasprintf . Print functions such as sprintf are very prone to buffer overflow errors. Any warnings from those flags being treated as errors. This warning includes uses of the assignment operator within an if statement. Due to the way that GDB is implemented most functions have unused parameters.