kernel/util: Fix Null pointer passed as 1st argument to memset()

Pointed out by Clang Static Analyzer.

Change-Id: I8ee4c5d6adac129fc7f3d4117081e0ac26dd2ea0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3759
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2021-03-02 05:54:23 +09:00 committed by Jérôme Duval
parent 78b1442051
commit 761714b3f6

View File

@ -32,10 +32,10 @@ Bitmap::Bitmap(int bitCount)
if (fBits == NULL) {
fSize = 0;
fInitStatus = B_NO_MEMORY;
} else {
fElementsCount = count;
memset(fBits, 0, sizeof(addr_t) * count);
}
fElementsCount = count;
memset(fBits, 0, sizeof(addr_t) * count);
}