Removed some redundant not-null checks
authorHerwin Weststrate <herwin@snt.utwente.nl>
Tue, 4 Nov 2014 19:24:30 +0000 (20:24 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 5 Nov 2014 13:08:09 +0000 (08:08 -0500)
src/modules/rlm_digest/rlm_digest.c
src/modules/rlm_mschap/rlm_mschap.c

index 4856359..c6a2d6b 100644 (file)
@@ -366,8 +366,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(UNUSED void *instance, REQU
                memcpy(&a1[a1_len], vp->vp_octets, vp->length);
                a1_len += vp->length;
 
-       } else if ((algo != NULL) &&
-                  (strcasecmp(algo->vp_strvalue, "MD5") != 0)) {
+       } else if (strcasecmp(algo->vp_strvalue, "MD5") != 0) {
                /*
                 *      We check for "MD5-sess" and "MD5".
                 *      Anything else is an error.
index 4d7adb1..b76e271 100644 (file)
@@ -1048,7 +1048,7 @@ static int CC_HINT(nonnull (1, 2, 4, 5 ,6)) do_mschap(rlm_mschap_t *inst, REQUES
                 *      then calculate the hash of the NT hash.  Doing this
                 *      here minimizes work for later.
                 */
-               if (password && !password->da->vendor &&
+               if (!password->da->vendor &&
                    (password->da->attr == PW_NT_PASSWORD)) {
                        fr_md4_calc(nthashhash, password->vp_octets, MD4_DIGEST_LENGTH);
                }