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:
@@ -4948,6 +4948,7 @@ nxt_unit_dequeue_request(nxt_unit_ctx_t *ctx)
|
|||||||
|
|
||||||
rc = nxt_unit_app_queue_recv(lib->shared_port, rbuf);
|
rc = nxt_unit_app_queue_recv(lib->shared_port, rbuf);
|
||||||
if (rc != NXT_UNIT_OK) {
|
if (rc != NXT_UNIT_OK) {
|
||||||
|
nxt_unit_read_buf_release(ctx, rbuf);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user