fix IPv6 relay url parsing
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 25 Jan 2011 20:15:25 +0000 (21:15 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 25 Jan 2011 20:15:25 +0000 (21:15 +0100)
citadel/modules/smtp/serv_smtpqueue.c

index b4ab587407bf325871d50ed0375229d79b0eaf16..5ae9796bdd0f703c6cad3eb33c7b7b5783488a0d 100644 (file)
@@ -649,9 +649,11 @@ int ParseURL(ParsedURL **Url, StrBuf *UrlStr, short DefaultPort)
                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;