aboutsummaryrefslogtreecommitdiff
path: root/lib/libradius/radlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libradius/radlib.c')
-rw-r--r--lib/libradius/radlib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c
index 2049468f455f..cd1f1df1b234 100644
--- a/lib/libradius/radlib.c
+++ b/lib/libradius/radlib.c
@@ -321,8 +321,10 @@ is_valid_request(struct rad_handle *h)
hctx = HMAC_CTX_new();
while (pos < len - 2) {
alen = h->in[pos + 1];
- if (alen < 2)
+ if (alen < 2) {
+ HMAC_CTX_free(hctx);
return (0);
+ }
if (h->in[pos] == RAD_MESSAGE_AUTHENTIC) {
if (len - pos < MD5_DIGEST_LENGTH + 2) {
HMAC_CTX_free(hctx);