From 85456fae54029edd26df2277a9eec5e2fe3d9739 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 1 Apr 2019 00:25:16 +0300 Subject: tdf#120703 PVS: Silence V522 warnings V522 There might be dereferencing of a potential null pointer. Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48 Reviewed-on: https://gerrit.libreoffice.org/70017 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- soltools/cpp/_tokens.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'soltools') 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 #include #include #include @@ -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; -- cgit v1.2.3