char *str = malloc (14);
sprintf(str, "%s", "one|two|three");
char *token1, *token2, *token3;
char *start = str;
token1 = str;
char *end = strchr (str, '|');
str = end + 1;
end = '\0';
token2 = str;
end = strchr (str, '|');
str = end + 1;
end = '\0';
...
free(start);
does that free work properly since I have been setting bytes within str to null in order to tokenize it?
Yes it works, free does not care where the null termination is. Or even if there is one. You can use malloc/free for any type of data not only null terminated strings.