svn commit: r311298 - head/sbin/dhclient

Alan Somers asomers at FreeBSD.org
Wed Jan 4 18:13:07 UTC 2017


Author: asomers
Date: Wed Jan  4 18:13:05 2017
New Revision: 311298
URL: https://svnweb.freebsd.org/changeset/base/311298

Log:
  Remove dead code in dhclient(8)
  
  The offending code has been dead ever since the import from OpenBSD in
  r195805.  OpenBSD later deleted that entire function.
  
  Reported by:	Coverity
  CID:		500059
  MFC after:	4 weeks
  Sponsored by:	Spectra Logic Corp

Modified:
  head/sbin/dhclient/dispatch.c

Modified: head/sbin/dhclient/dispatch.c
==============================================================================
--- head/sbin/dhclient/dispatch.c	Wed Jan  4 18:03:27 2017	(r311297)
+++ head/sbin/dhclient/dispatch.c	Wed Jan  4 18:13:05 2017	(r311298)
@@ -454,16 +454,12 @@ add_protocol(char *name, int fd, void (*
 void
 remove_protocol(struct protocol *proto)
 {
-	struct protocol *p, *next, *prev;
+	struct protocol *p, *next;
 
-	prev = NULL;
 	for (p = protocols; p; p = next) {
 		next = p->next;
 		if (p == proto) {
-			if (prev)
-				prev->next = p->next;
-			else
-				protocols = p->next;
+			protocols = p->next;
 			free(p);
 		}
 	}


More information about the svn-src-all mailing list