diff options
author | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-01-11 12:05:49 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-01-11 12:05:49 +0100 |
commit | fda4a6a8635254361196b0497803b7d01514203e (patch) | |
tree | 884dc2eb17cc521adade50e6368591958a39fff0 /src/UriParse.c | |
parent | 3ce62696a97c7fbed49079f8909f46f7c567ff5a (diff) | |
parent | 6e919c028d200a9a8da0c338261a1a736ed2a88d (diff) |
Merge branch 'release/debian/0.9.6+dfsg-1'debian/0.9.6+dfsg-1
Diffstat (limited to 'src/UriParse.c')
-rw-r--r-- | src/UriParse.c | 18 |
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); } |