diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2023-05-09 21:05:16 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2023-05-09 21:05:16 +0200 |
| commit | f2d5e4b995f910f7fce1034431da645a10b86b26 (patch) | |
| tree | 3f206bff20d35fc5979beee9e1a53b6580f8d3f0 /core/net/url.odin | |
| parent | 29e476201154821a06d11d29bb662f4c51f9fcca (diff) | |
fix leak in url_parse
Diffstat (limited to 'core/net/url.odin')
| -rw-r--r-- | core/net/url.odin | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/net/url.odin b/core/net/url.odin index a5e529928..460bb70ad 100644 --- a/core/net/url.odin +++ b/core/net/url.odin @@ -36,9 +36,11 @@ split_url :: proc(url: string, allocator := context.allocator) -> (scheme, host, s = s[:i] if query_str != "" { queries_parts := strings.split(query_str, "&") + defer delete(queries_parts) queries = make(map[string]string, len(queries_parts), allocator) for q in queries_parts { parts := strings.split(q, "=") + defer delete(parts) switch len(parts) { case 1: queries[parts[0]] = "" // NOTE(tetra): Query not set to anything, was but present. case 2: queries[parts[0]] = parts[1] // NOTE(tetra): Query set to something. |