I run my program using valgrind like this:

```
valgrind --leak-check=full ./a.out < in0.txt > out0.txt

```

and get the following output:

```
==13077== Memcheck, a memory error detector
==13077== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==13077== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==13077== Command: ./a.out
==13077==
==13077== Conditional jump or move depends on uninitialised value(s)
==13077==    at 0x40491F: OnGetMostViewedClasses (in /home/user/a.out)
==13077==    by 0x404498: parser (in /home/user/a.out)
==13077==    by 0x404263: main (in /home/user/a.out)
==13077==
==13077==
==13077== HEAP SUMMARY:
==13077==     in use at exit: 0 bytes in 0 blocks
==13077==   total heap usage: 90 allocs, 90 frees, 6,200 bytes allocated
==13077==
==13077== All heap blocks were freed -- no leaks are possible
==13077==
==13077== For counts of detected and suppressed errors, rerun with: -v
==13077== Use --track-origins=yes to see where uninitialised values come from
==13077== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
-bash-4.2$

```

while it refers to `StatusType res;` used in here:

```
static errorType OnGetMostViewedClasses(void* DS, const char* const command) {
    int numOfClasses;
    int *courses = NULL, *classes = NULL;
    StatusType res;

    ValidateRead(sscanf(command, "%d", &numOfClasses), 1, "%s failed.\n", commandStr[GETMOSTVIEWEDCLASSES_CMD]);
    if (numOfClasses > 0) {
        courses = (int *)malloc(numOfClasses * sizeof(int));
        classes = (int *)malloc(numOfClasses * sizeof(int));
        if (courses == NULL || classes == NULL) {
            res = ALLOCATION_ERROR;
        }
    }

    if (res != ALLOCATION_ERROR) {
        res = GetMostViewedClasses(DS, numOfClasses, courses, classes);
    }

    if (res != SUCCESS) {
        printf("%s: %s\n", commandStr[GETMOSTVIEWEDCLASSES_CMD], ReturnValToStr(res));
        if (courses != NULL) free(courses);
        if (classes != NULL) free(classes);
        return error_free;
    }

    printf("%s: %s\n", commandStr[GETMOSTVIEWEDCLASSES_CMD], ReturnValToStr(res));

    printf("Course\t|\tClass\n");

    for (int i = 0; i < numOfClasses; i++)
    {
        printf("%d\t|\t%d\n", courses[i], classes[i]);
    }

    printf("--End of most viewed classes--\n");

    if (courses != NULL) free(courses);
    if (classes != NULL) free(classes);

    return error_free;
}

```

and declared like this:

```
typedef enum {
    SUCCESS = 0,
    FAILURE = -1,
    ALLOCATION_ERROR = -2,
    INVALID_INPUT = -3
} StatusType;

```

**So my question is,** how can I solve this problem **without** changing the above code since it was given to us and my professor told: "you aren't allowed to change it" and "any errors found by valgrind will get you a mark of 0"?

Any ideas or suggestions are welcomed.

please note: except this problem I have 0 memory leak issue *(According to 32 input files I tested)*