fix: malloc error handling

This commit is contained in:
Simon Wiesend 2025-11-30 12:12:35 +01:00
parent 1c27338be2
commit 5050836020
Signed by: wiesendsi102436
GPG Key ID: C18A833054142CF0

View File

@ -26,6 +26,11 @@ unsigned int *createNumbers(unsigned int len)
{
unsigned int *randomNumbers = malloc(len * sizeof(int));
if (!randomNumbers)
{
return NULL;
}
// including upper limit
int upperLimit = len * 2;