]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/http: add helper assert to detect potential memleak
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 2 Jul 2021 09:46:45 +0000 (11:46 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 29 Jul 2021 12:03:11 +0000 (14:03 +0200)
daemon/http.c

index 4c6bb060def0e9f1c58b32aec3bb82227abd825b..0e8acc35fe86c7671808bbdf0dc5dde98952f39b 100644 (file)
@@ -365,6 +365,7 @@ static int header_callback(nghttp2_session *h2, const nghttp2_frame *frame,
                        return 0;
                }
 
+               kr_assert(ctx->uri_path == NULL);
                ctx->uri_path = malloc(sizeof(*ctx->uri_path) * (valuelen + 1));
                if (!ctx->uri_path)
                        return kr_error(ENOMEM);