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:
parent
78b1442051
commit
761714b3f6
@ -32,10 +32,10 @@ Bitmap::Bitmap(int bitCount)
|
|||||||
if (fBits == NULL) {
|
if (fBits == NULL) {
|
||||||
fSize = 0;
|
fSize = 0;
|
||||||
fInitStatus = B_NO_MEMORY;
|
fInitStatus = B_NO_MEMORY;
|
||||||
|
} else {
|
||||||
|
fElementsCount = count;
|
||||||
|
memset(fBits, 0, sizeof(addr_t) * count);
|
||||||
}
|
}
|
||||||
|
|
||||||
fElementsCount = count;
|
|
||||||
memset(fBits, 0, sizeof(addr_t) * count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user