1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

core: use structure itself for sizeof in two malloc

This commit is contained in:
Sebastien Helleu
2014-02-04 08:34:05 +01:00
parent 944972bc95
commit b91378fedc
+2 -2
View File
@@ -1189,7 +1189,7 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
}
/* create data for line */
new_line_data = malloc (sizeof (*(new_line->data)));
new_line_data = malloc (sizeof (*new_line_data));
if (!new_line_data)
{
free (new_line);
@@ -1337,7 +1337,7 @@ gui_line_add_y (struct t_gui_buffer *buffer, int y, const char *message)
return;
}
new_line_data = malloc (sizeof (*(new_line->data)));
new_line_data = malloc (sizeof (*new_line_data));
if (!new_line_data)
{
free (new_line);