From d15e6fb8b0ba10bee78086ccb07fc0d69bfbfebb Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Thu, 7 Jan 2021 13:35:21 +0100 Subject: [PATCH] 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. --- daemon/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.47.2