aboutsummaryrefslogtreecommitdiff
path: root/core/net
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2023-05-09 21:05:16 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2023-05-09 21:05:16 +0200
commitf2d5e4b995f910f7fce1034431da645a10b86b26 (patch)
tree3f206bff20d35fc5979beee9e1a53b6580f8d3f0 /core/net
parent29e476201154821a06d11d29bb662f4c51f9fcca (diff)
fix leak in url_parse
Diffstat (limited to 'core/net')
-rw-r--r--core/net/url.odin2
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.