mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
added check for proper memory allocation
This commit is contained in:
parent
9fde62ae30
commit
f119d14e7c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user