svn commit: r229900 - in stable/8/usr.sbin: fwcontrol newsyslog

Eitan Adler eadler at FreeBSD.org
Tue Jan 10 01:02:20 UTC 2012


Author: eadler (ports committer)
Date: Tue Jan 10 01:02:19 2012
New Revision: 229900
URL: http://svn.freebsd.org/changeset/base/229900

Log:
  - Remove extraneous null ptr deref checks
  - Fix memory leak
  
  Approved by:	jhb

Modified:
  stable/8/usr.sbin/fwcontrol/fwcontrol.c
  stable/8/usr.sbin/newsyslog/newsyslog.c
Directory Properties:
  stable/8/usr.sbin/fwcontrol/   (props changed)
  stable/8/usr.sbin/newsyslog/   (props changed)

Modified: stable/8/usr.sbin/fwcontrol/fwcontrol.c
==============================================================================
--- stable/8/usr.sbin/fwcontrol/fwcontrol.c	Tue Jan 10 01:01:57 2012	(r229899)
+++ stable/8/usr.sbin/fwcontrol/fwcontrol.c	Tue Jan 10 01:02:19 2012	(r229900)
@@ -152,8 +152,7 @@ str2node(int fd, const char *nodestr)
 		fweui2eui64(&data->dev[i].eui, &tmpeui);
 		if (memcmp(&eui, &tmpeui, sizeof(struct eui64)) == 0) {
 			node = data->dev[i].dst;
-			if (data != NULL)
-				free(data);
+			free(data);
 			goto gotnode;
 		}
 	}

Modified: stable/8/usr.sbin/newsyslog/newsyslog.c
==============================================================================
--- stable/8/usr.sbin/newsyslog/newsyslog.c	Tue Jan 10 01:01:57 2012	(r229899)
+++ stable/8/usr.sbin/newsyslog/newsyslog.c	Tue Jan 10 01:02:19 2012	(r229900)
@@ -1914,9 +1914,10 @@ do_zipwork(struct zipwork_entry *zwork)
 	pid_t pidzip, wpid;
 	char zresult[MAXPATHLEN];
 
+	assert(zwork != NULL);
 	pgm_path = NULL;
 	strlcpy(zresult, zwork->zw_fname, sizeof(zresult));
-	if (zwork != NULL && zwork->zw_conf != NULL &&
+	if (zwork->zw_conf != NULL &&
 	    zwork->zw_conf->compress > COMPRESS_NONE)
 		for (int c = 1; c < COMPRESS_TYPES; c++) {
 			if (zwork->zw_conf->compress == c) {


More information about the svn-src-stable-8 mailing list