From 478774eadab914c812356a3645003151292f257d Mon Sep 17 00:00:00 2001 From: Adam Julis Date: Tue, 19 Mar 2024 12:02:51 +0100 Subject: [PATCH] virt-admin: Fix segfault when libvirtd dies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vshAdmCatchDisconnect requires non-NULL structure vshControl for getting connection name (stored at opaque), but virAdmConnectRegisterCloseCallback at vshAdmConnect called it with NULL. Signed-off-by: Adam Julis Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- tools/virt-admin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 37bc6fe4f0..0766032e4a 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -112,7 +112,7 @@ vshAdmConnect(vshControl *ctl, unsigned int flags) return -1; } else { if (virAdmConnectRegisterCloseCallback(priv->conn, vshAdmCatchDisconnect, - NULL, NULL) < 0) + ctl, NULL) < 0) vshError(ctl, "%s", _("Unable to register disconnect callback")); if (priv->wantReconnect)