summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2011-12-21 20:27:41 +0000
committereadler <eadler@FreeBSD.org>2011-12-21 20:27:41 +0000
commit3c01e31040c2984c114ac9977789b76185e726e6 (patch)
tree7c566920fb5ced92e004cf337adc73daa4f7fdb7 /usr.sbin/newsyslog/newsyslog.c
parentd24fa001e9004ec4a6f53ac209eeb53f2b6cc1ab (diff)
downloadFreeBSD-src-3c01e31040c2984c114ac9977789b76185e726e6.zip
FreeBSD-src-3c01e31040c2984c114ac9977789b76185e726e6.tar.gz
- Remove extraneous null ptr deref checks
- Fix memory leak Submitted by: Slono Slono <slonoman2011@yandex.ru> Approved by: jhb MFC after: 1 week
Diffstat (limited to 'usr.sbin/newsyslog/newsyslog.c')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 191f077..0a0212e 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -1946,9 +1946,10 @@ do_zipwork(struct zipwork_entry *zwork)
char zresult[MAXPATHLEN];
int c;
+ 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 (c = 1; c < COMPRESS_TYPES; c++) {
if (zwork->zw_conf->compress == c) {
OpenPOWER on IntegriCloud