Shorten a long line, and don't leak buffer in paste_add if size is zero.

This commit is contained in:
nicm
2017-01-24 13:28:33 +00:00
parent 98e7fbb2ac
commit 3d74e89a39
2 changed files with 5 additions and 2 deletions

View File

@@ -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) {