From a7173c73c4e0a0b6a824e5bd950b7779ba91ef71 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Thu, 24 Sep 2009 13:32:09 -0500 Subject: [PATCH] Fix possible double free --- tools/virsh.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 4825f1c..fae12f9 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -8585,7 +8585,10 @@ static int vshDeinit(vshControl *ctl) { vshCloseLogFile(ctl); - free(ctl->name); + if (ctl->name) { + free(ctl->name); + ctl->name = NULL; + } if (ctl->conn) { if (virConnectClose(ctl->conn) != 0) { ctl->conn = NULL; /* prevent recursive call from vshError() */ -- 1.5.5.6