svn commit: r299023 - stable/9/contrib/bsnmp/gensnmptree

Garrett Cooper ngie at FreeBSD.org
Wed May 4 00:35:42 UTC 2016


Author: ngie
Date: Wed May  4 00:35:41 2016
New Revision: 299023
URL: https://svnweb.freebsd.org/changeset/base/299023

Log:
  MFstable/10 r299022:
  
  MFC r298450:
  
  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.
  
  CID: 1007408

Modified:
  stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)
  stable/9/contrib/bsnmp/   (props changed)

Modified: stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c
==============================================================================
--- stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c	Wed May  4 00:34:45 2016	(r299022)
+++ stable/9/contrib/bsnmp/gensnmptree/gensnmptree.c	Wed May  4 00:35:41 2016	(r299023)
@@ -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-all mailing list