Skip to content

Commit

Permalink
don't check for existence of struct. it always exists
Browse files Browse the repository at this point in the history
and clean up struct only if it was allocated
  • Loading branch information
alandekok committed Jun 17, 2019
1 parent c768132 commit 2103d78
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/rlm_krb5/rlm_krb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
memset(&client, 0, sizeof(client));

rcode = krb5_parse_user(&client, request, conn->context);
if (rcode != RLM_MODULE_OK) goto cleanup;
if (rcode != RLM_MODULE_OK) goto release;

/*
* Verify the user, using the options we set in instantiate
Expand Down Expand Up @@ -374,10 +374,9 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
}

cleanup:
if (client) {
krb5_free_principal(conn->context, client);
}
krb5_free_principal(conn->context, client);

release:
# ifdef KRB5_IS_THREAD_SAFE
fr_connection_release(inst->pool, conn);
# endif
Expand Down

0 comments on commit 2103d78

Please sign in to comment.