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 <[email protected]>
This commit is contained in:
Murai Takashi
2021-03-02 11:42:59 +00:00
committed by Jérôme Duval
parent 78b1442051
commit 761714b3f6
+3 -3
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);
}