newsyslog(8): Remove a NULL-check-after-use and instead assert != NULL.
authorSascha Wildner <saw@online.de>
Thu, 26 Jun 2014 20:21:56 +0000 (22:21 +0200)
committerSascha Wildner <saw@online.de>
Thu, 26 Jun 2014 20:21:56 +0000 (22:21 +0200)
Taken-from: FreeBSD

usr.sbin/newsyslog/newsyslog.c

index 07c1604..5a44759 100644 (file)
@@ -1890,9 +1890,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) {