svn commit: r298450 - head/contrib/bsnmp/gensnmptree
Garrett Cooper
ngie at FreeBSD.org
Fri Apr 22 05:24:17 UTC 2016
Author: ngie
Date: Fri Apr 22 05:24:15 2016
New Revision: 298450
URL: https://svnweb.freebsd.org/changeset/base/298450
Log:
Simplify always evaluated branch (`e != NULL`)
- xalloc(..) ensures that e will be non-null via malloc + err.
- `e` is already dereferenced above, so logically it's impossible
to hit the lower test without crashing if it was indeed NULL.
MFC after: 3 days
CID: 1007408
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
Modified:
head/contrib/bsnmp/gensnmptree/gensnmptree.c
Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c
==============================================================================
--- head/contrib/bsnmp/gensnmptree/gensnmptree.c Fri Apr 22 05:15:59 2016 (r298449)
+++ head/contrib/bsnmp/gensnmptree/gensnmptree.c Fri Apr 22 05:24:15 2016 (r298450)
@@ -743,10 +743,8 @@ parse_type(enum tok *tok, struct type *t
report("need value for ENUM/BITS");
if (gettoken() != TOK_STR)
report("need string in ENUM/BITS");
- if (e != NULL) {
- e->name = savetok();
- TAILQ_INSERT_TAIL(&t->enums, e, link);
- }
+ e->name = savetok();
+ TAILQ_INSERT_TAIL(&t->enums, e, link);
if ((*tok = gettoken()) == TOK_EOF)
report("unexpected EOF in ENUM/BITS");
} while (*tok != ')');
More information about the svn-src-head
mailing list