I am getting an error that says 'invalid read of size 4'
int **split_array(const int *s, int length) {
        int middle = length / 2;
        int remainder = length % 2; // if remainder is 1 1st subarray (even) needs 1 more element than odd
        int **odd_even_arrays = malloc(2 * sizeof(int*));
        if (remainder == 1) {
                odd_even_arrays[0] = malloc((middle + 1) * sizeof(int));
        }
        else {
                odd_even_arrays[0] = malloc(middle * sizeof(int));
        }
        odd_even_arrays[1] = malloc(middle * sizeof(int));

        for (int i = 0; i < length; i++) {
                odd_even_arrays[i % 2][i / 2] = s[i];
        }
        return odd_even_arrays;

}