confd: bridge: Refactor init_snippets() to avoid unreachable code

Fix coverity CID 464653
This commit is contained in:
Tobias Waldekranz
2025-02-16 10:55:03 +01:00
parent fe741a92f3
commit 3c0679991d
+3 -9
View File
@@ -426,10 +426,8 @@ static int init_snippets(struct ixif_br *br, struct lyd_node *dif, struct lyd_no
br->cif = cif;
br->ip = ip;
err = snippet_open(&br->bropts);
if (err)
goto err;
err = snippet_open(&br->bropts);
err = err ? : snippet_open(&br->init.vlan);
err = err ? : snippet_open(&br->init.mcast);
err = err ? : snippet_open(&br->init.mdb);
@@ -443,15 +441,11 @@ static int init_snippets(struct ixif_br *br, struct lyd_node *dif, struct lyd_no
snippet_close(&br->init.mdb, NULL);
snippet_close(&br->init.mcast, NULL);
snippet_close(&br->init.vlan, NULL);
goto err_close_bropts;
snippet_close(&br->bropts, NULL);
return err;
}
return 0;
err_close_bropts:
snippet_close(&br->bropts, NULL);
err:
return err;
}
static int collect_snippets(struct ixif_br *br)