From cb54bc65625abad9a0af501acac5c70fba17e2cc Mon Sep 17 00:00:00 2001 From: Dominique Pelle Date: Mon, 21 Jun 2021 20:15:37 +0200 Subject: patch 8.2.3030: Coverity reports a memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Coverity reports a memory leak. Solution: Fix the leak and a few typos. (Dominique Pellé, closes #8418) --- src/crypt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/crypt.c') diff --git a/src/crypt.c b/src/crypt.c index 35d4e14dc..f844e4209 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -819,19 +819,19 @@ crypt_sodium_decode( if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) { emsg(e_libsodium_cannot_decrypt_buffer); - return; + goto fail; } if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, buf_out, &buf_len, &tag, from, len, NULL, 0) != 0) { - emsg(e_libsodium_decription_failed); + emsg(e_libsodium_decryption_failed); goto fail; } sod_st->count++; if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) { - emsg(e_libsodium_decyption_failed_premature); + emsg(e_libsodium_decryption_failed_premature); goto fail; } if (p1 == p2) @@ -931,12 +931,12 @@ crypt_sodium_buffer_decode( if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, *buf_out, &out_len, &tag, from, len, NULL, 0) != 0) { - emsg(e_libsodium_decription_failed); + emsg(e_libsodium_decryption_failed); return -1; } if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) - emsg(e_libsodium_decyption_failed_premature); + emsg(e_libsodium_decryption_failed_premature); return (long) out_len; # else return -1; -- cgit v1.2.1