From: Laine Stump Date: Sun, 5 Jul 2020 02:29:23 +0000 (-0400) Subject: nwfilter: clear nrules when resetting virNWFilterInst X-Git-Tag: v6.6.0-rc1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9f829b66f910dbd63f819926ec15852113b03a8;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index b7633eb10a..aff42cbfb0 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -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; }