diff options
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/cpp/_tokens.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c index cb0beecf991d..c095ca6c6b9d 100644 --- a/soltools/cpp/_tokens.c +++ b/soltools/cpp/_tokens.c @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -217,6 +218,7 @@ Token * trp->max = 3 * trp->max / 2 + 1; trp->bp = (Token *) realloc(trp->bp, trp->max * sizeof(Token)); + assert(trp->bp); // realloc failure is OOM -> no point to handle trp->lp = &trp->bp[nlast]; trp->tp = &trp->bp[ncur]; return trp->lp; |