diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-11-19 13:49:12 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-11-19 13:49:12 +0300 |
commit | 2a381a82a6e1bc2bd5d2f43a08fce50a1994f2e8 (patch) | |
tree | c8cd93b1b5a8fdadf9e14d692df33159ccf13bb9 | |
parent | 18ddb747725d24a65b61e0b8ca5d072f52724190 (diff) | |
download | unit-2a381a82a6e1bc2bd5d2f43a08fce50a1994f2e8.tar.gz unit-2a381a82a6e1bc2bd5d2f43a08fce50a1994f2e8.tar.bz2 |
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.
-rw-r--r-- | src/nxt_unit.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |