Changed unnecessary mallocs into static allocation.
This commit is contained in:
parent
7d5ffb89a5
commit
0fb2d0b205
3 changed files with 7 additions and 17 deletions
|
|
@ -140,14 +140,13 @@ tox_weechat_identity_buffer_close_callback(void *data,
|
|||
int
|
||||
tox_weechat_bootstrap_tox(Tox *tox, const char *address, uint16_t port, const char *public_key)
|
||||
{
|
||||
char *binary_key = malloc(TOX_FRIEND_ADDRESS_SIZE);
|
||||
char binary_key[TOX_FRIEND_ADDRESS_SIZE];
|
||||
tox_weechat_hex2bin(public_key, binary_key);
|
||||
|
||||
int result = tox_bootstrap_from_address(tox,
|
||||
address,
|
||||
port,
|
||||
(uint8_t *)binary_key);
|
||||
free(binary_key);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue