summaryrefslogtreecommitdiffstats
path: root/cmd-load-buffer.c
diff options
context:
space:
mode:
authornicm <nicm>2020-09-04 12:24:25 +0000
committernicm <nicm>2020-09-04 12:24:25 +0000
commit9b45ba82fd38d30d9f6bbe3f659e33a32b3b5ace (patch)
treeda28472a8416049409cf0e6b73f8b0af1529d14f /cmd-load-buffer.c
parenteadf18b9fa3f32ffd06be5dbca627047430bc01c (diff)
calloc cb data so the client is NULL.
Diffstat (limited to 'cmd-load-buffer.c')
-rw-r--r--cmd-load-buffer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c
index f5a080be..bca9a860 100644
--- a/cmd-load-buffer.c
+++ b/cmd-load-buffer.c
@@ -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++;