Changed unnecessary mallocs into static allocation.
This commit is contained in:
parent
7d5ffb89a5
commit
0fb2d0b205
3 changed files with 7 additions and 17 deletions
|
@ -93,7 +93,7 @@ tox_weechat_friend_chat_new(struct t_tox_weechat_identity *identity,
|
|||
tox_get_client_id(identity->tox, friend_number, client_id);
|
||||
|
||||
// TODO: prepend identity name
|
||||
char *buffer_name = malloc(TOX_CLIENT_ID_SIZE * 2 + 1);
|
||||
char buffer_name[TOX_CLIENT_ID_SIZE * 2 + 1];
|
||||
tox_weechat_bin2hex(client_id, TOX_CLIENT_ID_SIZE, buffer_name);
|
||||
|
||||
chat->buffer = weechat_buffer_new(buffer_name,
|
||||
|
@ -102,8 +102,6 @@ tox_weechat_friend_chat_new(struct t_tox_weechat_identity *identity,
|
|||
tox_weechat_chat_refresh(chat);
|
||||
tox_weechat_chat_add(identity, chat);
|
||||
|
||||
free(buffer_name);
|
||||
|
||||
return chat;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue