From 6346e641eef4aacf92e81e0f1ea4f42ed1e62834 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 19 Sep 2019 16:28:03 +0300 Subject: [PATCH] Releasing WebSocket frame in case of buffer allocation failure. Found by Coverity (CID 349456). --- src/nxt_unit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nxt_unit.c b/src/nxt_unit.c index 9696e9cd..4497d09d 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -981,6 +981,8 @@ nxt_unit_process_websocket(nxt_unit_ctx_t *ctx, nxt_unit_recv_msg_t *recv_msg) nxt_unit_alert(ctx, "#%"PRIu32": failed to allocate buf", req_impl->stream); + nxt_unit_websocket_frame_release(&ws_impl->ws); + return NXT_UNIT_ERROR; }