Skip to content

Commit

Permalink
cls: avoid explicit free in nl_cli_cls_parse_ematch()
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Jan 12, 2025
1 parent 6bd2bd6 commit cc3bc99
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/cls.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ void nl_cli_cls_parse_proto(struct rtnl_cls *cls, char *arg)

struct rtnl_ematch_tree *nl_cli_cls_parse_ematch(struct rtnl_cls *cls, char *arg)
{
_nl_auto_free char *errstr = NULL;
struct rtnl_ematch_tree *tree;
char *errstr = NULL;
int err;

if ((err = rtnl_ematch_parse_expr(arg, &errstr, &tree)) < 0)
nl_cli_fatal(err, "Unable to parse ematch expression: %s",
errstr);

if (errstr)
free(errstr);

return tree;
}
Expand Down

1 comment on commit cc3bc99

@elfring
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 See also related information.

Please sign in to comment.