From 60a91be47b0773474c83ef29e1c809385cbddf51 Mon Sep 17 00:00:00 2001 From: Herwin Weststrate Date: Tue, 4 Nov 2014 20:24:30 +0100 Subject: [PATCH] Removed some redundant not-null checks --- src/modules/rlm_digest/rlm_digest.c | 3 +-- src/modules/rlm_mschap/rlm_mschap.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/rlm_digest/rlm_digest.c b/src/modules/rlm_digest/rlm_digest.c index 4856359..c6a2d6b 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 4d7adb1..b76e271 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); } -- 2.1.4