mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 14:26:39 +02:00
api: readjust string size in function string_dyn_free when string is not freed (issue #1875)
This frees some allocated memory if size_alloc was greater than size in the dynamic string.
This commit is contained in:
@@ -574,8 +574,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
||||
-1);
|
||||
}
|
||||
}
|
||||
str_hotlist = *hotlist;
|
||||
weechat_string_dyn_free (hotlist, 0);
|
||||
str_hotlist = weechat_string_dyn_free (hotlist, 0);
|
||||
}
|
||||
}
|
||||
weechat_hashtable_set (
|
||||
@@ -655,15 +654,15 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
||||
line_number++;
|
||||
}
|
||||
|
||||
str_buflist = *buflist;
|
||||
str_buflist = weechat_string_dyn_free (buflist, 0);
|
||||
|
||||
goto end;
|
||||
|
||||
error:
|
||||
weechat_string_dyn_free (buflist, 1);
|
||||
str_buflist = NULL;
|
||||
|
||||
end:
|
||||
weechat_string_dyn_free (buflist, 0);
|
||||
weechat_arraylist_free (buffers);
|
||||
|
||||
if ((line_number_current_buffer != old_line_number_current_buffer[item_index])
|
||||
|
||||
@@ -372,10 +372,7 @@ irc_join_build_string (struct t_arraylist *arraylist)
|
||||
|
||||
end:
|
||||
if (channels)
|
||||
{
|
||||
result = *channels;
|
||||
weechat_string_dyn_free (channels, 0);
|
||||
}
|
||||
result = weechat_string_dyn_free (channels, 0);
|
||||
if (keys)
|
||||
weechat_string_dyn_free (keys, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user