nwfilter: clear nrules when resetting virNWFilterInst

It's possible/probable the callers to virNWFilterInstReset() make it
unnecessary to set the object's nrules to 0 after freeing all its
rules, but that same function is setting nfilters to 0, so let's do
the same for the sake of consistency.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Laine Stump 2020-07-04 22:29:23 -04:00
parent 4686116075
commit b9f829b66f

View File

@ -240,6 +240,7 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
for (i = 0; i < inst->nrules; i++)
virNWFilterRuleInstFree(inst->rules[i]);
VIR_FREE(inst->rules);
inst->nrules = 0;
}