virsh.c: avoid leak on OOM error path

* tools/virsh.c (cmdCPUBaseline): Also free "buffer" and "list" upon OOM.
This commit is contained in:
Jim Meyering 2010-02-19 18:03:41 +01:00
parent 72919f3d35
commit 27fc6782bc
1 changed files with 2 additions and 0 deletions

View File

@ -7139,6 +7139,8 @@ cleanup:
return ret; return ret;
no_memory: no_memory:
VIR_FREE(list);
VIR_FREE(buffer);
vshError(ctl, "%s", _("Out of memory")); vshError(ctl, "%s", _("Out of memory"));
ret = FALSE; ret = FALSE;
return ret; return ret;