mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
res_crypto: Memory issues and uninitialized variable errors
ASTERISK-30235 Change-Id: Ia1e326e7b52cd06fd5e6c9009e3e63193c92f6cd
This commit is contained in:
@@ -49,7 +49,7 @@ static const char *old_key_dir = NULL;
|
||||
|
||||
static char *hexstring(const unsigned char *data, unsigned datalen)
|
||||
{
|
||||
char *buf = alloca(datalen * 2 + 1);
|
||||
char *buf = ast_malloc(datalen * 2 + 1);
|
||||
unsigned n;
|
||||
|
||||
for (n = 0; n < datalen; ++n) {
|
||||
@@ -532,6 +532,7 @@ AST_TEST_DEFINE(crypto_aes_encrypt)
|
||||
res = AST_TEST_PASS;
|
||||
|
||||
cleanup:
|
||||
ast_free(args[KEY]);
|
||||
ast_test_capture_free(&cap);
|
||||
return res;
|
||||
}
|
||||
@@ -610,6 +611,7 @@ AST_TEST_DEFINE(crypto_aes_decrypt)
|
||||
res = AST_TEST_PASS;
|
||||
|
||||
cleanup:
|
||||
ast_free(args[KEY]);
|
||||
ast_test_capture_free(&cap);
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user