Skip to content

Commit

Permalink
confd: bridge: Refactor init_snippets() to avoid unreachable code
Browse files Browse the repository at this point in the history
Fix coverity CID 464653
  • Loading branch information
wkz committed Feb 15, 2025
1 parent 24eac1b commit 462bc47
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/confd/src/infix-if-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 462bc47

Please sign in to comment.