diff options
author | Ed Tanous <ed@tanous.net> | 2020-10-15 19:41:17 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-10-23 18:29:24 +0300 |
commit | f23b729676559f539790580930b1ff3b0c05805b (patch) | |
tree | c068573cefdfd5e6dff266fc6a9c1e530af9b491 /include/pam_authenticate.hpp | |
parent | 04e438cbad66838724d78ce12f28aff1fb892a63 (diff) | |
download | bmcweb-f23b729676559f539790580930b1ff3b0c05805b.tar.xz |
Turn on ALL perf checks
1st, alphabetize the tidy-list for good housekeeping.
Next, enable all the clang-tidy performance checks, and resolve all the
issues. most of the issues boil down to:
1. Using std::move on const variables. This does nothing.
2. Passing big variables (like std::string) by value.
3. Using double quotes on a find call, which constructs an intermediate
string, rather than using the character overload.
Tested
Loaded on system, logged in successfully and pulled down webui-vue. No
new errors.
Walked the Redfish tree a bit, and observed no new problems.
Ran redfish service validator. Got no new failures (although there are
a lot of log service deprecation warnings that we should look at).
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I2238958c4b22c1e554e09a0a1787c744bdbca43e
Diffstat (limited to 'include/pam_authenticate.hpp')
-rw-r--r-- | include/pam_authenticate.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp index 3e5c6915c5..12f19c0a9c 100644 --- a/include/pam_authenticate.hpp +++ b/include/pam_authenticate.hpp @@ -25,15 +25,16 @@ inline int pamFunctionConversation(int numMsg, const struct pam_message** msg, std::strncpy(pass, appPass, appPassSize + 1); - *resp = reinterpret_cast<pam_response*>( - calloc(static_cast<size_t>(numMsg), sizeof(struct pam_response))); - - if (resp == nullptr) + void* ptr = + calloc(static_cast<size_t>(numMsg), sizeof(struct pam_response)); + if (ptr == nullptr) { free(pass); return PAM_AUTH_ERR; } + *resp = reinterpret_cast<pam_response*>(ptr); + for (int i = 0; i < numMsg; ++i) { /* Ignore all PAM messages except prompting for hidden input */ |