summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-10-23 00:49:25 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-10-23 00:49:25 +0000
commite63909655cf2fa3afa1513f5c54f9fd7322d43a6 (patch)
treeb27e250c544970a9e67ce05a5120239b467ecccf
parent6821ccc8824588652db3d5805cf2e2fd143e8d42 (diff)
Plug a memory leak and update some comments, from Tiago Cunha.
-rw-r--r--cmd-load-buffer.c3
-rw-r--r--cmd-save-buffer.c2
-rw-r--r--cmd-set-buffer.c2
-rw-r--r--cmd-show-buffer.c2
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 *);