From e63909655cf2fa3afa1513f5c54f9fd7322d43a6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 23 Oct 2011 00:49:25 +0000 Subject: [PATCH] Plug a memory leak and update some comments, from Tiago Cunha. --- cmd-load-buffer.c | 3 ++- cmd-save-buffer.c | 2 +- cmd-set-buffer.c | 2 +- cmd-show-buffer.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c index 34792048..a14f699e 100644 --- a/cmd-load-buffer.c +++ b/cmd-load-buffer.c @@ -27,7 +27,7 @@ #include "tmux.h" /* - * Loads a session paste buffer from a file. + * Loads a paste buffer from a file. */ int cmd_load_buffer_exec(struct cmd *, struct cmd_ctx *); @@ -125,6 +125,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) } if (paste_replace(&global_buffers, buffer, pdata, psize) != 0) { ctx->error(ctx, "no buffer %d", buffer); + xfree(pdata); return (-1); } diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c index 6fd65696..586fbbba 100644 --- a/cmd-save-buffer.c +++ b/cmd-save-buffer.c @@ -25,7 +25,7 @@ #include "tmux.h" /* - * Saves a session paste buffer to a file. + * Saves a paste buffer to a file. */ int cmd_save_buffer_exec(struct cmd *, struct cmd_ctx *); diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 14fef135..4f3d87a7 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -23,7 +23,7 @@ #include "tmux.h" /* - * Add or set a session paste buffer. + * Add or set a paste buffer. */ int cmd_set_buffer_exec(struct cmd *, struct cmd_ctx *); diff --git a/cmd-show-buffer.c b/cmd-show-buffer.c index 23490169..17d4509d 100644 --- a/cmd-show-buffer.c +++ b/cmd-show-buffer.c @@ -23,7 +23,7 @@ #include "tmux.h" /* - * Show a session paste buffer. + * Show a paste buffer. */ int cmd_show_buffer_exec(struct cmd *, struct cmd_ctx *);