From: Tomas Krizek Date: Thu, 7 Jan 2021 12:35:21 +0000 (+0100) Subject: daemon/http: ensure uri_path is freed for POST X-Git-Tag: v5.3.0~25^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d15e6fb8b0ba10bee78086ccb07fc0d69bfbfebb;p=thirdparty%2Fknot-resolver.git daemon/http: ensure uri_path is freed for POST Since #636 was implemented, uri_path is also saved for POST requests and thus needs to be freed. --- diff --git a/daemon/http.c b/daemon/http.c index 944d21a30..7e52b8dfd 100644 --- a/daemon/http.c +++ b/daemon/http.c @@ -387,11 +387,11 @@ static int on_frame_recv_callback(nghttp2_session *h2, const nghttp2_frame *fram if (process_uri_path(ctx, ctx->uri_path, stream_id) < 0) { refuse_stream(h2, stream_id); } - free(ctx->uri_path); - ctx->uri_path = NULL; } ctx->incomplete_stream = -1; ctx->current_method = HTTP_METHOD_NONE; + free(ctx->uri_path); + ctx->uri_path = NULL; len = ctx->buf_pos - sizeof(uint16_t); if (len <= 0 || len > KNOT_WIRE_MAX_PKTSIZE) {