Static analysis FTW

- a bit of leftovers for previous commit found by static analyzer
This commit is contained in:
Nikolaj Schlej 2016-04-17 01:48:07 +02:00
parent cda0018a29
commit dd0efa2410
2 changed files with 23 additions and 8 deletions

View File

@ -530,16 +530,23 @@ STATIC
UINT32 Index;
mText = malloc (WNDSIZ * 2 + MAXMATCH);
if (!mText) return EFI_OUT_OF_RESOURCES;
for (Index = 0; Index < WNDSIZ * 2 + MAXMATCH; Index++) {
mText[Index] = 0;
}
mLevel = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mLevel));
if (!mLevel) return EFI_OUT_OF_RESOURCES;
mChildCount = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mChildCount));
if (!mChildCount) return EFI_OUT_OF_RESOURCES;
mPosition = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mPosition));
if (!mPosition) return EFI_OUT_OF_RESOURCES;
mParent = malloc (WNDSIZ * 2 * sizeof (*mParent));
if (!mParent) return EFI_OUT_OF_RESOURCES;
mPrev = malloc (WNDSIZ * 2 * sizeof (*mPrev));
if (!mPrev) return EFI_OUT_OF_RESOURCES;
mNext = malloc ((MAX_HASH_VAL + 1) * sizeof (*mNext));
if (!mNext) return EFI_OUT_OF_RESOURCES;
mBufSiz = BLKSIZ;
mBuf = malloc (mBufSiz);

View File

@ -30,6 +30,8 @@ QString regionTypeToQString(const UINT8 type)
case Subtypes::EcRegion: return QObject::tr("EC");
case Subtypes::Reserved4Region: return QObject::tr("Reserved4");
};
return QObject::tr("Unknown");
}
QString itemTypeToQString(const UINT8 type)
@ -59,6 +61,8 @@ QString itemTypeToQString(const UINT8 type)
case Types::Microcode: return QObject::tr("Microcode");
case Types::SlicData: return QObject::tr("SLIC data");
}
return QObject::tr("Unknown");
}
QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype)
@ -128,6 +132,8 @@ QString itemSubtypeToQString(const UINT8 type, const UINT8 subtype)
if (subtype == Subtypes::AmdMicrocode) return QObject::tr("AMD");
break;
}
return QObject::tr("Unknown");
}
QString compressionTypeToQString(const UINT8 algorithm)
@ -155,4 +161,6 @@ QString actionTypeToQString(const UINT8 action)
case Actions::Rebuild: return QObject::tr("Rebuild");
case Actions::Rebase: return QObject::tr("Rebase");
}
return QObject::tr("Unknown");
}