mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
pki_crypto: Fix possible memory leak on error
CID #1409680 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -1576,9 +1576,9 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
|
||||
ssh_signature sig)
|
||||
{
|
||||
uint32_t pad_len = 0;
|
||||
char *blob_orig;
|
||||
char *blob_padded_data;
|
||||
ssh_string sig_blob_padded;
|
||||
char *blob_orig = NULL;
|
||||
char *blob_padded_data = NULL;
|
||||
ssh_string sig_blob_padded = NULL;
|
||||
|
||||
size_t rsalen = 0;
|
||||
size_t len = ssh_string_len(sig_blob);
|
||||
@@ -1636,6 +1636,7 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
|
||||
return SSH_OK;
|
||||
|
||||
errout:
|
||||
SSH_STRING_FREE(sig_blob_padded);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user