summaryrefslogtreecommitdiffstats
path: root/paste.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-02-19 15:05:07 +0000
committerThomas Adam <thomas@xteddy.org>2014-02-19 15:05:07 +0000
commitca1d78f5230e0c3ab4c3b15fff2597fbdb037b48 (patch)
treea9e33fd328e948a4ef9a57d6cc2fe3d82cbf128c /paste.c
parentb3de4a3dec85bc84bb83da6b46e2a8e2a634ace3 (diff)
parent6daf06b1ad61f67e9f7780d787451b9b5f82dd43 (diff)
Merge branch 'obsd-master'
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 7cbbbfb3..bc9b4686 100644
--- a/paste.c
+++ b/paste.c
@@ -130,8 +130,10 @@ paste_replace(struct paste_stack *ps, u_int idx, char *data, size_t size)
{
struct paste_buffer *pb;
- if (size == 0)
+ if (size == 0) {
+ free(data);
return (0);
+ }
if (idx >= ARRAY_LENGTH(ps))
return (-1);