From 140309620aba6e3697b35bdac1851a3f0090d4d6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 31 Jan 2022 20:37:58 +0300 Subject: [PATCH] Free recv_buf in nbd_proxy --- src/nbd_proxy.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nbd_proxy.cpp b/src/nbd_proxy.cpp index db46d086..60876922 100644 --- a/src/nbd_proxy.cpp +++ b/src/nbd_proxy.cpp @@ -55,6 +55,15 @@ protected: iovec read_iov = { 0 }; public: + ~nbd_proxy() + { + if (recv_buf) + { + free(recv_buf); + recv_buf = NULL; + } + } + static json11::Json::object parse_args(int narg, const char *args[]) { json11::Json::object cfg; @@ -322,6 +331,9 @@ public: delete cli; delete epmgr; delete ringloop; + cli = NULL; + epmgr = NULL; + ringloop = NULL; } void load_module()