cppcheck nullPointerOutOfMemory
This commit is contained in:
1 parent
e42932738e
commit
ad84875afd
44 files changed
+314
-5
No files matched your search
@@ -737,6 +737,10 @@ int main(int argc, const char *argv[]) {
|
||||
printf("----------- " _CYAN_("Phase 1 pre-processing") " ------------------------\n");
|
||||
printf("Testing default keys using NESTED authentication...\n");
|
||||
struct thread_key_args *def = calloc(1, sizeof(struct thread_key_args));
|
||||
if (def == NULL) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
def->thread = 0;
|
||||
def->idx = 0;
|
||||
def->uid = uid;
|
||||
@@ -758,6 +762,10 @@ int main(int argc, const char *argv[]) {
|
||||
// the rest of available threads to EV1 scenario
|
||||
for (int i = 0; i < thread_count; ++i) {
|
||||
struct thread_args *a = calloc(1, sizeof(struct thread_args));
|
||||
if (a == NULL) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
a->xored = xored;
|
||||
a->thread = i;
|
||||
a->idx = i;
|
||||
@@ -780,6 +788,10 @@ int main(int argc, const char *argv[]) {
|
||||
// the rest of available threads to EV1 scenario
|
||||
for (int i = 0; i < thread_count; ++i) {
|
||||
struct thread_args *a = calloc(1, sizeof(struct thread_args));
|
||||
if (a == NULL) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
a->xored = xored;
|
||||
a->thread = i;
|
||||
a->idx = i;
|
||||
@@ -823,6 +835,10 @@ int main(int argc, const char *argv[]) {
|
||||
// threads
|
||||
for (int i = 0; i < thread_count; ++i) {
|
||||
struct thread_key_args *b = calloc(1, sizeof(struct thread_key_args));
|
||||
if (b == NULL) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
b->thread = i;
|
||||
b->idx = i;
|
||||
b->uid = uid;
|
||||
|
||||
@@ -290,6 +290,10 @@ int main(int argc, const char *argv[]) {
|
||||
// threads
|
||||
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->uid = uid;
|
||||
|
||||
Reference in new issue
Block a user