Re: g_error_free() warning on null pointer
- Date: Sat, 29 Aug 2015 14:13:28 -0400
- From: Michael McConville <mmcconv1@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: g_error_free() warning on null pointer
Nicolas George wrote:
> But maybe I am forgetting another case: can you imagine a code snippet
> where g_error_free(error) would make sense with error == NULL?
I may have already mentioned this, but the simplest example is just
adding a g_error_free() at the end of a function when adding a GError*
declaration at the beginning. This prevents an irrelevant line from
cluttering the error-handling logic and makes it more trivially obvious
to auditors that there isn't a memory leak.
gtk-devel-list mailing list