r15098 - gnucash/trunk/src/gnome-utils - gnc_history_get_last() can return NULL.

Thomas Bushnell BSG tb at becket.net
Thu Nov 9 22:19:57 EST 2006


On Thu, 2006-11-09 at 22:07 -0500, Per Bojsen wrote:
> *** Regarding Re: r15098 - gnucash/trunk/src/gnome-utils -
>     gnc_history_get_last() can return NULL.; Derek Atkins
>     <warlord at MIT.EDU> adds:
> 
> Derek> free() still doesn't check, but g_free() does.
> 
> Actually at least on Linux, according to man 3 free:
> 
>   If ptr is NULL, no operation is performed.
> 
> I don't have my K&R handy so I am not sure if the C standard specifies
> this.  However, the man page states that it conforms to C89 and C99.
> free() is from glibc and I'm pretty sure it's been like this for quite
> a few years.

In old standard C, it was not allowed to free a null pointer; in ANSI C
it is explicitly allowed.

Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20061109/bfc2bd4c/attachment.bin 


More information about the gnucash-devel mailing list