summaryrefslogtreecommitdiff
path: root/src/UriParse.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhsoting.net>2022-01-09 18:59:52 +0100
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2022-01-09 18:59:52 +0100
commitf308d3149d855c4d6d0251cf6bce393dfa371329 (patch)
tree1c109543808e40e553cfea44f1329bd410f743ff /src/UriParse.c
parentd336d9867cfdbf1683653de369d67f5c7bea3f5e (diff)
parent592ab485a70ab4c8e4cefc37bbdfb76110f9205e (diff)
Update upstream source from tag 'upstream/0.9.6'
Update to upstream version '0.9.6' with Debian dir 046219032722c15fb3571e4dcdc4a0f0c418b137
Diffstat (limited to 'src/UriParse.c')
-rw-r--r--src/UriParse.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/UriParse.c b/src/UriParse.c
index 0bc8f0a..eefa8d1 100644
--- a/src/UriParse.c
+++ b/src/UriParse.c
@@ -2287,22 +2287,24 @@ int URI_FUNC(FreeUriMembersMm)(URI_TYPE(Uri) * uri, UriMemoryManager * memory) {
uri->userInfo.afterLast = NULL;
}
- /* Host data - IPvFuture */
+ /* Host data - IPvFuture (may affect host text) */
if (uri->hostData.ipFuture.first != NULL) {
+ /* NOTE: .hostData.ipFuture may hold the very same range pointers
+ * as .hostText; then we need to prevent freeing memory twice. */
+ if (uri->hostText.first == uri->hostData.ipFuture.first) {
+ uri->hostText.first = NULL;
+ uri->hostText.afterLast = NULL;
+ }
+
if (uri->hostData.ipFuture.first != uri->hostData.ipFuture.afterLast) {
memory->free(memory, (URI_CHAR *)uri->hostData.ipFuture.first);
}
uri->hostData.ipFuture.first = NULL;
uri->hostData.ipFuture.afterLast = NULL;
- uri->hostText.first = NULL;
- uri->hostText.afterLast = NULL;
}
- /* Host text (if regname, after IPvFuture!) */
- if ((uri->hostText.first != NULL)
- && (uri->hostData.ip4 == NULL)
- && (uri->hostData.ip6 == NULL)) {
- /* Real regname */
+ /* Host text (after IPvFuture, see above) */
+ if (uri->hostText.first != NULL) {
if (uri->hostText.first != uri->hostText.afterLast) {
memory->free(memory, (URI_CHAR *)uri->hostText.first);
}