From b9c02fbeb7efb7d0593b33485fb30c298291cf80 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 7 Dec 2015 12:44:48 +0100 Subject: cipher: Improve error handling. * cipher/ecc.c (ecc_decrypt_raw): Improve error handling. -- Found using the Clang Static Analyzer. Signed-off-by: Justus Winter --- cipher/ecc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cipher') diff --git a/cipher/ecc.c b/cipher/ecc.c index e4e9139d..105650e0 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -1591,7 +1591,10 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms) rawmpi = _gcry_mpi_get_buffer_extra (x, ec->nbits/8, -1, &rawmpilen, NULL); if (!rawmpi) - rc = gpg_err_code_from_syserror (); + { + rc = gpg_err_code_from_syserror (); + goto leave; + } else { rawmpi[0] = 0x40; -- cgit v1.2.1