From: Herwin Weststrate Date: Tue, 4 Nov 2014 19:24:30 +0000 (+0100) Subject: Removed some redundant not-null checks X-Git-Tag: branch_3_1_x~4771^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c918e39c2eb99f24efb2b872b7fd2061ae76ccfe;p=thirdparty%2Ffreeradius-server.git Removed some redundant not-null checks --- diff --git a/src/modules/rlm_digest/rlm_digest.c b/src/modules/rlm_digest/rlm_digest.c index 4856359f4ce..c6a2d6b83e3 100644 --- a/src/modules/rlm_digest/rlm_digest.c +++ b/src/modules/rlm_digest/rlm_digest.c @@ -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. diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index 4d7adb1e66f..b76e2712946 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -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); }