Kaydet (Commit) 2f6d20d4 authored tarafından Mike Kaganski's avatar Mike Kaganski

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: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst dfee8f56
...@@ -374,16 +374,13 @@ static HWPDrawingObject *LoadDrawingObject(void) ...@@ -374,16 +374,13 @@ static HWPDrawingObject *LoadDrawingObject(void)
// drawing object can be list. // drawing object can be list.
// hdo = current item, head = 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;
{
hdo->type = HWPDO_RECT;
}
HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
delete hdo;
} }
HWPDOFunc(hdo, OBJFUNC_FREE, nullptr, 0);
delete hdo;
if( prev ) if( prev )
{ {
prev->next = nullptr; prev->next = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment