added check for proper memory allocation

This commit is contained in:
Mazzoleni Alice Francesca 2025-04-10 11:29:01 +02:00
parent 9fde62ae30
commit f119d14e7c

View File

@ -2262,6 +2262,11 @@ void *start_timer(void *arg) {
char *imageData = (char *)malloc(imageSize);
memset(imageData, 0, imageSize);
if (imageData == NULL) {
LOG(logERROR, ("Can not allocate image Data RAM."
"Probable cause: Memory Leak.\n"));
return FAIL;
}
/*
for (int i = 0; i < imageSize; i += sizeof(uint16_t)) {
*((uint16_t *)(imageData + i)) = i;