From f2d5e4b995f910f7fce1034431da645a10b86b26 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Tue, 9 May 2023 21:05:16 +0200 Subject: [PATCH] fix leak in url_parse --- core/net/url.odin | 2 ++ 1 file changed, 2 insertions(+) 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.