[Snowball-discuss] Missing out of memory checks

From: Olly Betts (olly@survex.com)
Date: Fri Apr 29 2005 - 13:19:00 BST


I've noticed that both api.c and utilities.c call malloc (and calloc)
but don't check the return value to see if the allocation failed.
They only allocate modest amounts of memory, but that doesn't make
this lack of checking safe.

I'm not quite sure how to fix this - the error needs to propagate back
up the chain of calling functions, and that means most functions need to
be altered to return an error (in some cases this is just a spec change,
in others more work is needed).

I'll work up a patch, but it might take a while for me to get round to
it so I wanted to warn people.

Cheers,
    Olly



This archive was generated by hypermail 2.1.3 : Thu Sep 20 2007 - 12:02:47 BST