void FreeURL(ParsedURL** Url)
{
- FreeStrBuf(&(*Url)->URL);
- free(*Url);
- *Url = NULL;
+ if (*Url != NULL) {
+ FreeStrBuf(&(*Url)->URL);
+ if ((*Url)->Next != NULL)
+ FreeURL(&(*Url)->Next);
+ free(*Url);
+ *Url = NULL;
+ }
}
void FreeMailQEntry(void *qv)
url->Host ++;
pEndHost = strchr(url->Host, ']');
if (pEndHost == NULL) {
+ FreeStrBuf(&url->URL);
free(url);
return 0; /* invalid syntax, no ipv6 */
}
+ StrBufPeek(url->URL, pEndHost, 0, '\0');
if (*(pEndHost + 1) == ':'){
StrBufPeek(url->URL, pEndHost + 1, 0, '\0');
pPort = pEndHost + 2;