From: Tomas Krizek Date: Fri, 2 Jul 2021 09:46:45 +0000 (+0200) Subject: daemon/http: add helper assert to detect potential memleak X-Git-Tag: v5.4.0~1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=298003f754667daab44239cf6da29ee155cbc0b7;p=thirdparty%2Fknot-resolver.git daemon/http: add helper assert to detect potential memleak --- diff --git a/daemon/http.c b/daemon/http.c index 4c6bb060d..0e8acc35f 100644 --- a/daemon/http.c +++ b/daemon/http.c @@ -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);