Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2016 00:34:45 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r299022 - stable/10/contrib/bsnmp/gensnmptree
Message-ID:  <201605040034.u440YjQi050655@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed May  4 00:34:45 2016
New Revision: 299022
URL: https://svnweb.freebsd.org/changeset/base/299022

Log:
  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/10/contrib/bsnmp/gensnmptree/gensnmptree.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c
==============================================================================
--- stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c	Wed May  4 00:30:36 2016	(r299021)
+++ stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c	Wed May  4 00:34:45 2016	(r299022)
@@ -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 != ')');



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605040034.u440YjQi050655>