diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-01 00:25:16 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-01 00:49:12 +0200 |
commit | 85456fae54029edd26df2277a9eec5e2fe3d9739 (patch) | |
tree | fd55ad48b34c66f0b839edcbc952a8a5a0752c72 /soltools | |
parent | 1d35b89e7581e12024769d19bfb6d6eb2c3274b8 (diff) |
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 <mike.kaganski@collabora.com>
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; |