[Snowball-discuss] Missing out of memory checks
Olly Betts
olly at survex.com
Fri Apr 29 13:19:00 BST 2005
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
More information about the Snowball-discuss
mailing list