cppcheck nullPointerOutOfMemory

This commit is contained in:
Philippe Teuwen 2025-03-24 23:46:43 +01:00
commit ad84875afd
44 changed files with 314 additions and 5 deletions

View file

@ -277,6 +277,10 @@ int main(int argc, char *argv[]) {
uint64_t stop_time = time(NULL);
for (int i = 0; i < thread_count; ++i) {
struct thread_args *a = calloc(1, sizeof(struct thread_args));
if (a == NULL) {
fprintf(stderr, "Failed to allocate memory for thread arguments\n");
exit(EXIT_FAILURE);
}
a->thread = i;
a->idx = i;
a->starttime = start_time;