mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
Fix memory leak in OOM cleanup
This commit is contained in:
parent
b6cd099df4
commit
bf79e90f3a
@ -1,3 +1,8 @@
|
|||||||
|
Mon Jul 7 10:39:56 BST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/capabilities.c: Refactor to avoid memory leak when in
|
||||||
|
cleanup from OOM condition
|
||||||
|
|
||||||
Mon Jun 30 14:07:56 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
|
Mon Jun 30 14:07:56 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
|
||||||
|
|
||||||
Compilation fix for MinGW
|
Compilation fix for MinGW
|
||||||
|
@ -224,17 +224,19 @@ virCapabilitiesAddHostNUMACell(virCapsPtr caps,
|
|||||||
|
|
||||||
if (VIR_ALLOC(cell) < 0)
|
if (VIR_ALLOC(cell) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
caps->host.numaCell[caps->host.nnumaCell] = cell;
|
|
||||||
|
|
||||||
if (VIR_ALLOC_N(caps->host.numaCell[caps->host.nnumaCell]->cpus,
|
if (VIR_ALLOC_N(cell->cpus, ncpus) < 0) {
|
||||||
ncpus) < 0)
|
VIR_FREE(cell);
|
||||||
return -1;
|
return -1;
|
||||||
memcpy(caps->host.numaCell[caps->host.nnumaCell]->cpus,
|
}
|
||||||
|
memcpy(cell->cpus,
|
||||||
cpus,
|
cpus,
|
||||||
ncpus * sizeof(*cpus));
|
ncpus * sizeof(*cpus));
|
||||||
|
|
||||||
caps->host.numaCell[caps->host.nnumaCell]->ncpus = ncpus;
|
cell->ncpus = ncpus;
|
||||||
caps->host.numaCell[caps->host.nnumaCell]->num = num;
|
cell->num = num;
|
||||||
|
|
||||||
|
caps->host.numaCell[caps->host.nnumaCell] = cell;
|
||||||
caps->host.nnumaCell++;
|
caps->host.nnumaCell++;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user