From b9f829b66f910dbd63f819926ec15852113b03a8 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Sat, 4 Jul 2020 22:29:23 -0400 Subject: [PATCH] nwfilter: clear nrules when resetting virNWFilterInst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/nwfilter/nwfilter_gentech_driver.c | 1 + 1 file changed, 1 insertion(+) 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; }