mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 12:05:17 +00: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. (cherry picked from commit b1675bac67c590ffd68b38a6fdacc66442ca7b8c)
This commit is contained in:
parent
870094c1e1
commit
6fba8c1f37
@ -375,6 +375,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…
x
Reference in New Issue
Block a user