Correction to lab1.c program Where we allocate memory to the pointer **arr change it to this... arr = (char **)malloc(count * sizeof(char *)); ---------------- We are allocating an array of pointers. The size was 1-byte instead of 8-bytes for a pointer. valgrind likes the program now.