What is this memory error allocation error that is caused from the code?

==40742== Invalid write of size 4
==40742==    at 0x10929A: split_array (split_array.c:22)
==40742==    by 0x1093B3: main (split_array.c:57)
==40742==  Address 0x4a730e4 is 0 bytes after a block of size 4 alloc'd
==40742==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==40742==    by 0x109224: split_array (split_array.c:17)
==40742==    by 0x1093B3: main (split_array.c:57)

#include <stdio.h>
#include <stdlib.h>

/* Return a pointer to an array of two dynamically allocated arrays of ints.
   The first array contains the elements of the input array s that are
   at even indices.  The second array contains the elements of the input
   array s that are at odd indices.

   Do not allocate any more memory than necessary. You are not permitted
   to include math.h.  You can do the math with modulo arithmetic and integer
   division.
*/
int **split_array(const int *s, int length) {
	// the array containg the two pointers to the even and odd arrays
	int **complete_arr = malloc(sizeof(int*) * 2);
	// even array 
	complete_arr[0] = malloc(sizeof(int)*(length/2));
	// odd array 
	complete_arr[1] = malloc(sizeof(int)*(length/2));
	for (int i = 0; i < length; i++) {
		if (i % 2 == 0) {
			complete_arr[0][i/2] = s[i];
		}
		else {
			complete_arr[1][i/2] = s[i];
    }
	}
	return complete_arr;
}

/* Return a pointer to an array of ints with size elements.
   - strs is an array of strings where each element is the string
     representation of an integer.
   - size is the size of the array
 */

int *build_array(char **strs, int size) {
	// Create dynamic array
	int *arr = malloc(sizeof(int)*size);
	// Convert string to integers
	for (int i = 0; i < size; i++){
    // the first element is always the name of the program and argv is an array of strings
    if (i != 0) {
      arr[i - 1] = strtol(strs[i], NULL, 10); // Something is wrong here
    }
	}
	return arr;
}


int main(int argc, char **argv) {
    /* Replace the comments in the next two lines with the appropriate
       arguments.  Do not add any additional lines of code to the main
       function or make other changes.
     */
    int *full_array = build_array(argv, argc);
    int **result = split_array(full_array, argc);

    printf("Original array:\n");
    for (int i = 0; i < argc - 1; i++) {
        printf("%d ", full_array[i]);
    }
    printf("\n");

    printf("result[0]:\n");
    for (int i = 0; i < argc / 2; i++) {
        printf("%d ", result[0][i]);
    }
    printf("\n");

    printf("result[1]:\n");
    for (int i = 0; i < (argc - 1) / 2; i++) {
        printf("%d ", result[1][i]);
    }
    printf("\n");
    free(full_array);
    free(result[0]);
    free(result[1]);
    free(result);
    return 0;
}
