Skip to content
Snippets Groups Projects
Commit 75414c4d authored by alexander.lysikov's avatar alexander.lysikov
Browse files

fixed a few memory leaks

parent 41e4dded
No related branches found
No related tags found
1 merge request!24Support 3689
...@@ -169,7 +169,7 @@ dap_chain_sign_t * dap_chain_sign_create(dap_enc_key_t *a_key, const void * a_da ...@@ -169,7 +169,7 @@ dap_chain_sign_t * dap_chain_sign_create(dap_enc_key_t *a_key, const void * a_da
uint8_t* l_sign = DAP_NEW_Z_SIZE(uint8_t, l_sign_size); uint8_t* l_sign = DAP_NEW_Z_SIZE(uint8_t, l_sign_size);
// calc signature [sign_size may decrease slightly] // calc signature [sign_size may decrease slightly]
if(dap_chain_sign_create_output(a_key, a_data, a_data_size, l_sign, &l_sign_size) != 0) { if(dap_chain_sign_create_output(a_key, a_data, a_data_size, l_sign, &l_sign_size) != 0) {
DAP_DELETE(l_sign); dap_enc_key_signature_delete(a_key->type, l_sign);
DAP_DELETE(l_pub_key); DAP_DELETE(l_pub_key);
return NULL; return NULL;
} else { } else {
...@@ -184,7 +184,7 @@ dap_chain_sign_t * dap_chain_sign_create(dap_enc_key_t *a_key, const void * a_da ...@@ -184,7 +184,7 @@ dap_chain_sign_t * dap_chain_sign_create(dap_enc_key_t *a_key, const void * a_da
l_ret->header.sign_pkey_size = l_pub_key_size; l_ret->header.sign_pkey_size = l_pub_key_size;
l_ret->header.sign_size = l_sign_size; l_ret->header.sign_size = l_sign_size;
DAP_DELETE(l_sign_ser); DAP_DELETE(l_sign_ser);
DAP_DELETE(l_sign); dap_enc_key_signature_delete(a_key->type, l_sign);
DAP_DELETE(l_pub_key); DAP_DELETE(l_pub_key);
return l_ret; return l_ret;
} }
...@@ -271,7 +271,8 @@ int dap_chain_sign_verify(dap_chain_sign_t * a_chain_sign, const void * a_data, ...@@ -271,7 +271,8 @@ int dap_chain_sign_verify(dap_chain_sign_t * a_chain_sign, const void * a_data,
default: default:
l_ret = -1; l_ret = -1;
} }
DAP_DELETE(l_sign); dap_enc_key_signature_delete(l_key->type, l_sign);
dap_enc_key_delete(l_key);
return l_ret; return l_ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment