mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +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>
(cherry picked from commit 72498bac5f)
This commit is contained in:
@@ -1569,9 +1569,9 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
|
|||||||
ssh_signature sig)
|
ssh_signature sig)
|
||||||
{
|
{
|
||||||
uint32_t pad_len = 0;
|
uint32_t pad_len = 0;
|
||||||
char *blob_orig;
|
char *blob_orig = NULL;
|
||||||
char *blob_padded_data;
|
char *blob_padded_data = NULL;
|
||||||
ssh_string sig_blob_padded;
|
ssh_string sig_blob_padded = NULL;
|
||||||
|
|
||||||
size_t rsalen = 0;
|
size_t rsalen = 0;
|
||||||
size_t len = ssh_string_len(sig_blob);
|
size_t len = ssh_string_len(sig_blob);
|
||||||
@@ -1629,6 +1629,7 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
|
|||||||
return SSH_OK;
|
return SSH_OK;
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
SSH_STRING_FREE(sig_blob_padded);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user