X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=crypto%2Frfc3986.re;h=feaf49ac0340942c92700db180b867c49ce4d61b;hp=463486f6968549138fd98c5a5b2476b1dd4434dc;hb=1866e46f857c0790bfa2996f75df0f5e08cdb090;hpb=bc2b876ae20675d2673f5b57db10ddc99c063e63 diff --git a/crypto/rfc3986.re b/crypto/rfc3986.re index 463486f..feaf49a 100644 --- a/crypto/rfc3986.re +++ b/crypto/rfc3986.re @@ -205,7 +205,6 @@ int tls_parse_uri(char *s, struct tls_uri *uri) { percent_decode(uri->host); percent_decode(uri->path); percent_decode(uri->query); - if (uri->path == NULL || uri->path[0] == 0) { free(uri->path); @@ -215,10 +214,21 @@ int tls_parse_uri(char *s, struct tls_uri *uri) { return rv; } +#define MARK fprintf(stderr, "%s %s:%d\n", __FILE__, __func__, __LINE__) void tls_free_uri(struct tls_uri *uri) { + if (!uri) return; + free(uri->host); + uri->host = 0; free(uri->path); + uri->path = 0; free(uri->query); + uri->query = 0; free(uri->port); + uri->port = 0; free(uri->scheme); + uri->scheme = 0; + free(uri->fragment); + uri->fragment = 0; + }