aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_timestamp
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-12-14 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-12-14 08:00:00 +0000
commit954234f0a477636eab751a6601d34bab1db41b0e (patch)
tree83403cf711c78b112e2738eb82b35d801cce18ee /modules/pam_timestamp
parent297f0b554e497e95c891fd6a77f7ac5591649f26 (diff)
downloadpam-954234f0a477636eab751a6601d34bab1db41b0e.tar.gz
pam-954234f0a477636eab751a6601d34bab1db41b0e.tar.bz2
pam-954234f0a477636eab751a6601d34bab1db41b0e.zip
treewide: assume free(NULL) is no-op
The C standard guarantees that if the argument of free() is a null pointer, no action occurs.
Diffstat (limited to 'modules/pam_timestamp')
-rw-r--r--modules/pam_timestamp/hmac_openssl_wrapper.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/pam_timestamp/hmac_openssl_wrapper.c b/modules/pam_timestamp/hmac_openssl_wrapper.c
index ac434377..a59a8de2 100644
--- a/modules/pam_timestamp/hmac_openssl_wrapper.c
+++ b/modules/pam_timestamp/hmac_openssl_wrapper.c
@@ -297,9 +297,7 @@ hmac_management(pam_handle_t *pamh, int debug, void **out, size_t *out_length,
ret = PAM_SUCCESS;
done:
- if (hmac_message != NULL) {
- free(hmac_message);
- }
+ free(hmac_message);
if (key != NULL) {
pam_overwrite_n(key, key_length);
free(key);