Date: Tue, 10 Jan 2012 01:02:19 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r229900 - in stable/8/usr.sbin: fwcontrol newsyslog Message-ID: <201201100102.q0A12JML072727@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201100102.q0A12JML072727>