From 077cd1737678fe541511a0752e6a618410ad8afe Mon Sep 17 00:00:00 2001 From: Yury Luneff Date: Mon, 16 Nov 2026 22:01:32 +0300 Subject: [PATCH] Free NBD netlink sockets with nl_socket_free() netlink_sock_free() released the socket from nl_socket_alloc() with a plain free(), leaking its file descriptor and its callback set. With LeakSanitizer, netlink-unmap then exits with a non-zero code. --- src/client/nbd_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/nbd_proxy.cpp b/src/client/nbd_proxy.cpp index d857e0d9..386cb341 100644 --- a/src/client/nbd_proxy.cpp +++ b/src/client/nbd_proxy.cpp @@ -76,7 +76,7 @@ static void netlink_sock_alloc(struct netlink_ctx *ctx) static void netlink_sock_free(struct netlink_ctx *ctx) { - free(ctx->sk); + nl_socket_free(ctx->sk); ctx->sk = NULL; } -- 2.47.3