From 2a381a82a6e1bc2bd5d2f43a08fce50a1994f2e8 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 19 Nov 2020 13:49:12 +0300 Subject: [PATCH] Libunit: fixing read buffer leakage. If shared queue is empty, allocated read buffer should be explicitly released. Found by Coverity (CID 363943). The issue was introduced in f5ba5973a0a3. --- src/nxt_unit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nxt_unit.c b/src/nxt_unit.c index 0790afc4..097f50d6 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -4948,6 +4948,7 @@ nxt_unit_dequeue_request(nxt_unit_ctx_t *ctx) rc = nxt_unit_app_queue_recv(lib->shared_port, rbuf); if (rc != NXT_UNIT_OK) { + nxt_unit_read_buf_release(ctx, rbuf); goto done; }