qof_backend_init

Neil Williams linux at codehelp.co.uk
Mon Jan 3 09:42:17 EST 2005


On Monday 03 January 2005 2:17 pm, Chris Shoemaker wrote:
> On Mon, Jan 03, 2005 at 12:14:31PM +0000, Neil Williams wrote:
> > Lines 129+130 in qofbackend.c  are confusing me:
> >
> > 129    if (be->error_msg) g_free (be->error_msg);
> > 130    be->error_msg = NULL;
> >
> > I'm getting a segmentation fault because error_msg exists but is out of
> > bounds. Why would it exist before g_new had finished? Why is it checked?
> > Wouldn't any uninitialised value be out of range?
>
> g_new doesn't zero memory, g_new0 does.

Thanks. Sorted - I called be = g_new0( etc. and it's fine.

-- 

Neil Williams
=============
http://www.dclug.org.uk/
http://www.nosoftwarepatents.com/
http://sourceforge.net/projects/isbnsearch/
http://www.williamsleesmill.me.uk/
http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050103/2721504f/attachment.bin


More information about the gnucash-devel mailing list