From d50758cbfe7741650bc470f349ead29f824dd182 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 10 Jun 2014 16:15:02 +0200 Subject: [PATCH] route: remove unnecessary non-null check in pktloc and ematch This check is not necessary, and also they cause coverity to complain. Acked-by: Thomas Graf Signed-off-by: Thomas Haller --- lib/route/cls/ematch.c | 4 +--- lib/route/pktloc.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/route/cls/ematch.c b/lib/route/cls/ematch.c index 779bf8b..ab30324 100644 --- a/lib/route/cls/ematch.c +++ b/lib/route/cls/ematch.c @@ -654,9 +654,7 @@ int rtnl_ematch_parse_expr(const char *expr, char **errp, goto errout; } - if (scanner) - ematch_lex_destroy(scanner); - + ematch_lex_destroy(scanner); *result = tree; return 0; diff --git a/lib/route/pktloc.c b/lib/route/pktloc.c index 9fcf4a4..5bb841c 100644 --- a/lib/route/pktloc.c +++ b/lib/route/pktloc.c @@ -138,8 +138,7 @@ static int read_pktlocs(void) last_read = st.st_mtime; errout_scanner: - if (scanner) - pktloc_lex_destroy(scanner); + pktloc_lex_destroy(scanner); errout_close: fclose(fd); errout: -- 2.40.0