summaryrefslogtreecommitdiffstats
path: root/hwpfilter
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-10-21 22:08:21 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-21 23:53:28 +0200
commit2f6d20d4ff8a308979f84d823211408363502fac (patch)
tree5cebc06591a621623aef59cd5f9ebd77d0797ed2 /hwpfilter
parenttdf#120703 (PVS): redundant nullptr checks (diff)
downloadcore-2f6d20d4ff8a308979f84d823211408363502fac.tar.gz
core-2f6d20d4ff8a308979f84d823211408363502fac.zip
tdf#120703 (PVS): redundant nullptr check
V668 There is no sense in testing the 'hdo' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Change-Id: Ic889dcba4e9d77a6dd27dd1603ed37d39e9fe581 Reviewed-on: https://gerrit.libreoffice.org/62152 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/drawing.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index 3118ec0c8720..975dfaa0e8be 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -374,16 +374,13 @@ static HWPDrawingObject *LoadDrawingObject(void)
// drawing object can be list.
// hdo = current item, head = list;
- if (hdo != nullptr)
+ if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
{
- if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
- {
- hdo->type = HWPDO_RECT;
- }
-
- HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
- delete hdo;
+ hdo->type = HWPDO_RECT;
}
+ HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
+ delete hdo;
+
if( prev )
{
prev->next = nullptr;