mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09:00
pki_gcrypt: Fix memory leak
* src/pki_gcrypt.c (b64decode_rsa_privatekey): Free 'v' on version mismatch. (b64decode_dsa_privatekey): Likewise. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
9a54f91bb7
commit
e1d36314a2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user