diff options
| author | abs <abs@NetBSD.org> | 2022-05-29 10:51:41 +0000 |
|---|---|---|
| committer | abs <abs@NetBSD.org> | 2022-05-29 10:51:41 +0000 |
| commit | f4f27b4c6e27b857e0e77a138b3bbdbbe8f72f10 (patch) | |
| tree | ef56b0b6b1972f18fc910e2fa6a8612743fcda3c /lib/libcrypt | |
| parent | 2574c6773a0f15cce03319553a0bb9183ffa9a12 (diff) | |
Free strdup'd value in libargon decode_option error paths
If its worth freeing in the success path, its worth freeing in the
error path... (given we don't _exit or similar)
Diffstat (limited to 'lib/libcrypt')
| -rw-r--r-- | lib/libcrypt/crypt-argon2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcrypt/crypt-argon2.c b/lib/libcrypt/crypt-argon2.c index 0617a35d702..31b0fdaf97b 100644 --- a/lib/libcrypt/crypt-argon2.c +++ b/lib/libcrypt/crypt-argon2.c @@ -328,6 +328,7 @@ decode_option(argon2_context *ctx, argon2_type *atype, const char *option) } break; default: + free(in); return -1; } @@ -337,8 +338,10 @@ decode_option(argon2_context *ctx, argon2_type *atype, const char *option) sl = ctx->saltlen; - if (from_base64(ctx->salt, &sl, a) == NULL) + if (from_base64(ctx->salt, &sl, a) == NULL) { + free(in); return -1; + } ctx->saltlen = sl; |
