summaryrefslogtreecommitdiff
path: root/src/core/core-crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core-crypto.c')
-rw-r--r--src/core/core-crypto.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/core-crypto.c b/src/core/core-crypto.c
index 709b46201..4d0e6e9f2 100644
--- a/src/core/core-crypto.c
+++ b/src/core/core-crypto.c
@@ -610,10 +610,8 @@ weecrypto_totp_generate (const char *secret_base32, time_t totp_time,
return result;
error:
- if (secret)
- free (secret);
- if (result)
- free (result);
+ free (secret);
+ free (result);
return NULL;
}
@@ -676,7 +674,6 @@ weecrypto_totp_validate (const char *secret_base32, time_t totp_time,
return otp_ok;
error:
- if (secret)
- free (secret);
+ free (secret);
return 0;
}