]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
route: remove unnecessary non-null check in pktloc and ematch
authorThomas Haller <thaller@redhat.com>
Tue, 10 Jun 2014 14:15:02 +0000 (16:15 +0200)
committerThomas Haller <thaller@redhat.com>
Tue, 10 Jun 2014 19:45:52 +0000 (21:45 +0200)
This check is not necessary, and also they cause coverity to
complain.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/route/cls/ematch.c
lib/route/pktloc.c

index 779bf8b8f67c76817cfe05c3035a922200f8b2e9..ab303248008f12169ba6871a635b3687b2a972a2 100644 (file)
@@ -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;
index 9fcf4a4c11d16dcc4efe76361716f24034886445..5bb841c15ee21c32ad9ee3a2e50f6d8be5da7f7a 100644 (file)
@@ -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: