diff options
author | nicm <nicm> | 2014-02-17 23:07:03 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-02-17 23:07:03 +0000 |
commit | 6daf06b1ad61f67e9f7780d787451b9b5f82dd43 (patch) | |
tree | adcac8b7975434a335487147e09920c26593039e /window-copy.c | |
parent | 69b7c496accc2a646e5e2dee7870bea1194a6641 (diff) |
Fix memory leaks with paste_replace, based on changes from J Raynor.
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/window-copy.c b/window-copy.c index df4ca55a..76c9c3ce 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1455,8 +1455,8 @@ window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len) if (idx == -1) { limit = options_get_number(&global_options, "buffer-limit"); paste_add(&global_buffers, buf, len, limit); - } else - paste_replace(&global_buffers, idx, buf, len); + } else if (paste_replace(&global_buffers, idx, buf, len) != 0) + free(buf); } void |