summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-load-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-09-04 12:24:25 +0000
committernicm <nicm@openbsd.org>2020-09-04 12:24:25 +0000
commita1750446ae984b1c82bf8bbed8ed9ae10d56ef22 (patch)
tree27857bd6ba78607d3746d3a889c3790a44975b9a /usr.bin/tmux/cmd-load-buffer.c
parentCreate ERRORS section for ober_read_elements. (diff)
downloadwireguard-openbsd-a1750446ae984b1c82bf8bbed8ed9ae10d56ef22.tar.xz
wireguard-openbsd-a1750446ae984b1c82bf8bbed8ed9ae10d56ef22.zip
calloc cb data so the client is NULL.
Diffstat (limited to 'usr.bin/tmux/cmd-load-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-load-buffer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c
index 191bed6ec95..6f1bb94aedb 100644
--- a/usr.bin/tmux/cmd-load-buffer.c
+++ b/usr.bin/tmux/cmd-load-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-load-buffer.c,v 1.61 2020/09/02 13:46:35 nicm Exp $ */
+/* $OpenBSD: cmd-load-buffer.c,v 1.62 2020/09/04 12:24:25 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -96,12 +96,10 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item)
const char *bufname = args_get(args, 'b');
char *path;
- cdata = xmalloc(sizeof *cdata);
+ cdata = xcalloc(1, sizeof *cdata);
cdata->item = item;
if (bufname != NULL)
cdata->name = xstrdup(bufname);
- else
- cdata->name = NULL;
if (args_has(args, 'w') && tc != NULL) {
cdata->client = tc;
cdata->client->references++;