Skip to content

Commit cc3bc99

Browse files
committed
cls: avoid explicit free in nl_cli_cls_parse_ematch()
1 parent 6bd2bd6 commit cc3bc99

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/lib/cls.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,13 @@ void nl_cli_cls_parse_proto(struct rtnl_cls *cls, char *arg)
5050

5151
struct rtnl_ematch_tree *nl_cli_cls_parse_ematch(struct rtnl_cls *cls, char *arg)
5252
{
53+
_nl_auto_free char *errstr = NULL;
5354
struct rtnl_ematch_tree *tree;
54-
char *errstr = NULL;
5555
int err;
5656

5757
if ((err = rtnl_ematch_parse_expr(arg, &errstr, &tree)) < 0)
5858
nl_cli_fatal(err, "Unable to parse ematch expression: %s",
5959
errstr);
60-
61-
if (errstr)
62-
free(errstr);
6360

6461
return tree;
6562
}

0 commit comments

Comments
 (0)