request = malloc( ((tok - &(*argv[1])) - sizeof(argv[1])) + sizeof(char) * 17 + 1 + 4 );

what length are you trying to allocate here?


sprintf(request, "%s %s %s", "GET", &(*argv[1]) + (tok -...