CLD should check result of "new" in all use cases
Opened this issue · 0 comments
GoogleCodeExporter commented
There are many uses of the "new" operator in the CLD source code, such as in
scoreonescriptspan.cc's "new ScoringHitBuffer":
https://code.google.com/p/cld2/source/browse/trunk/internal/scoreonescriptspan.c
c#1168
There's no check that the "new" operator successfully allocated memory. In
low-memory conditions this can lead to an access violation and subsequent crash.
The code should fail gracefully under low-memory conditions, though it isn't
immediately obvious how to "gracefully" fail or how helpful it would be to the
caller to have such behavior if they are truly out of memory.
Original issue reported on code.google.com by andrewha...@google.com
on 7 Jan 2015 at 12:19