[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] pki_gcrypt: Fix memory leak
[Thread Prev] | [Thread Next]
- Subject: [PATCH 2/6] pki_gcrypt: Fix memory leak
- From: Justus Winter <justus@xxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 14 Mar 2016 16:31:58 +0100
- To: libssh@xxxxxxxxxx
- Cc: Justus Winter <justus@xxxxxxxxxxx>
* src/pki_gcrypt.c (b64decode_rsa_privatekey): Free 'v' on version mismatch. (b64decode_dsa_privatekey): Likewise. Signed-off-by: Justus Winter <justus@xxxxxxxxxxx> --- src/pki_gcrypt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c index 16e4833..d75223f 100644 --- a/src/pki_gcrypt.c +++ b/src/pki_gcrypt.c @@ -471,6 +471,7 @@ static int b64decode_rsa_privatekey(const char *pkey, gcry_sexp_t *r, data = ssh_string_data(v); if (ssh_string_len(v) != 1 || data[0] != 0) { + ssh_string_free(v); ssh_buffer_free(buffer); return 0; } @@ -547,6 +548,7 @@ static int b64decode_dsa_privatekey(const char *pkey, gcry_sexp_t *r, ssh_auth_c data = ssh_string_data(v); if (ssh_string_len(v) != 1 || data[0] != 0) { + ssh_string_free(v); ssh_buffer_free(buffer); return 0; } -- 2.1.4
[PATCH 1/6] torture: Fix guard | Justus Winter <justus@xxxxxxxxxxx> |