]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nwfilter: clear nrules when resetting virNWFilterInst
authorLaine Stump <laine@redhat.com>
Sun, 5 Jul 2020 02:29:23 +0000 (22:29 -0400)
committerLaine Stump <laine@redhat.com>
Mon, 20 Jul 2020 23:13:21 +0000 (19:13 -0400)
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>
src/nwfilter/nwfilter_gentech_driver.c

index b7633eb10a9dbe708a00cf60d984c3291a24fb73..aff42cbfb0c1d55685dcf60bc8b72bf6c679fa1a 100644 (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;
 }