mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
nwfilter: Fix memory leak
Below patch fixes this coverity report: /libvirt/src/conf/nwfilter_conf.c:382: leaked_storage: Variable "varAccess" going out of scope leaks the storage it points to.
This commit is contained in:
parent
5bb83236c9
commit
b1675bac67
@ -379,6 +379,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
|
|||||||
|
|
||||||
if (VIR_EXPAND_N(nwf->varAccess, nwf->nVarAccess, 1) < 0) {
|
if (VIR_EXPAND_N(nwf->varAccess, nwf->nVarAccess, 1) < 0) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
|
virNWFilterVarAccessFree(varAccess);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user