summaryrefslogtreecommitdiffstats
path: root/paste.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-24 13:28:33 +0000
committernicm <nicm>2017-01-24 13:28:33 +0000
commit3d74e89a395838e5c9c4ea101a9366be09bf03c7 (patch)
treebd06ce22c748e13a05ec84606202d1f60eb51835 /paste.c
parent98e7fbb2acee0238381feea5d583fc439aae08e2 (diff)
Shorten a long line, and don't leak buffer in paste_add if size is zero.
Diffstat (limited to 'paste.c')
-rw-r--r--paste.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/paste.c b/paste.c
index d3a90a78..c76c52e5 100644
--- a/paste.c
+++ b/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) {