Okay, another minor style issue that is probably questionable.  Right now this function does up to four allocations for the pieces of the URL and later on, you have to do four frees, but each piece is just a substring of the existing URL. Instead, you could just do a strdup() of the URL, pass it in as a `char *` instead of a `const char *` and make it so that this function just injected NUL terminators at the end of each part and returned a pointer into the string to the beginning of each part. Later on, you would just have to call a single free() to release the memory. Actually, the callers are generally already strdup'ing the original URL from what I can see, but I'm not sure where and how that full URL gets used, so it might not be okay to modify it in place.