[libvirt] [PATCH] virsh: fix memory leak in virsh when starting a guest with invalid fd

2014-02-20 Thread Jincheng Miao
When start a guest with --pass-fd, if the argument of --pass-fd is invalid, virsh will exit, but doesn't free the variable 'dom'. The valgrind said: ... ==24569== 63 (56 direct, 7 indirect) bytes in 1 blocks are definitely lost in loss record 130 of 234 ==24569==at 0x4C2A1D4: calloc (in

Re: [libvirt] [PATCH] virsh: fix memory leak in virsh when starting a guest with invalid fd

2014-02-20 Thread Eric Blake
On 02/20/2014 02:29 AM, Jincheng Miao wrote: When start a guest with --pass-fd, if the argument of --pass-fd is invalid, virsh will exit, but doesn't free the variable 'dom'. +++ b/tools/virsh-domain.c @@ -3428,11 +3428,11 @@ cmdStart(vshControl *ctl, const vshCmd *cmd) if

Re: [libvirt] [PATCH] virsh: fix memory leak in virsh when starting a guest with invalid fd

2014-02-20 Thread Jincheng Miao
- Original Message - On 02/20/2014 02:29 AM, Jincheng Miao wrote: When start a guest with --pass-fd, if the argument of --pass-fd is invalid, virsh will exit, but doesn't free the variable 'dom'. +++ b/tools/virsh-domain.c @@ -3428,11 +3428,11 @@ cmdStart(vshControl *ctl,