From: Thomas Haller Date: Tue, 10 Jun 2014 14:15:02 +0000 (+0200) Subject: route: remove unnecessary non-null check in pktloc and ematch X-Git-Tag: libnl3_2_25rc1~11^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d50758cbfe7741650bc470f349ead29f824dd182;p=thirdparty%2Flibnl.git 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 --- 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: