[Geany-devel] [Patch] after g_strndup, use g_free instead of free

Enrico Tröger enrico.troeger at xxxxx
Sun May 16 17:46:45 UTC 2010

On Fri, 14 May 2010 23:23:20 -0700, Daniel wrote:

> I believe g_strndup should be followed by g_free. I tested that the
> code compiles and runs. But no real runtime testing was done.

Thank you, committed.

Just for clarity, there is no technical requirement that g_strndup() or
similar should be followed by a g_free() instead of free().
g_free() simply calls free() with the difference that it checks for a
NULL pointer before which is good in most cases.
And using g_free() there is also better for readability.


Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100516/44b8072f/attachment.pgp>

More information about the Devel mailing list