mirror of
https://github.com/tmux/tmux.git
synced 2025-09-06 19:38:21 +00:00
Shorten a long line, and don't leak buffer in paste_add if size is zero.
This commit is contained in:
4
paste.c
4
paste.c
@@ -163,8 +163,10 @@ paste_add(char *data, size_t size)
|
||||
struct paste_buffer *pb, *pb1;
|
||||
u_int limit;
|
||||
|
||||
if (size == 0)
|
||||
if (size == 0) {
|
||||
free(data);
|
||||
return;
|
||||
}
|
||||
|
||||
limit = options_get_number(global_options, "buffer-limit");
|
||||
RB_FOREACH_REVERSE_SAFE(pb, paste_time_tree, &paste_by_time, pb1) {
|
||||
|
Reference in New Issue
Block a user