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.
This commit is contained in:
Max Romanov
2020-11-19 13:49:12 +03:00
parent 18ddb74772
commit 2a381a82a6

View File

@@ -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;
}