From: Arran Cudbard-Bell Date: Mon, 22 Jun 2015 21:16:21 +0000 (-0400) Subject: Slightly more efficient X-Git-Tag: release_3_0_9~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d01167a6b3867650c9143e1f8733a0903c22fbb;p=thirdparty%2Ffreeradius-server.git Slightly more efficient --- diff --git a/src/modules/rlm_ldap/sasl.c b/src/modules/rlm_ldap/sasl.c index 0cd7e86ba25..00a3ded5f6b 100644 --- a/src/modules/rlm_ldap/sasl.c +++ b/src/modules/rlm_ldap/sasl.c @@ -128,8 +128,6 @@ ldap_rcode_t rlm_ldap_sasl_interactive(rlm_ldap_t const *inst, REQUEST *request, NULL, NULL, LDAP_SASL_AUTOMATIC, _sasl_interact, &sasl_ctx, result, &mech, &msgid); - ldap_msgfree(result); /* We always need to free the old message */ - result = NULL; /* * If ldap_sasl_interactive_bind indicates it didn't want @@ -141,9 +139,11 @@ ldap_rcode_t rlm_ldap_sasl_interactive(rlm_ldap_t const *inst, REQUEST *request, */ if (ret != LDAP_SASL_BIND_IN_PROGRESS) { status = rlm_ldap_result(inst, conn, -1, identity, NULL, error, extra); - break; + break; /* Old result gets freed on after exit */ } + ldap_msgfree(result); /* We always need to free the old message */ + /* * If LDAP parse result indicates there was an error * then we're done.