diff options
author | nicm <nicm> | 2016-10-26 11:48:07 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-10-26 11:48:07 +0000 |
commit | abea17afd9e85d88a14be0222d094c37ef7975b6 (patch) | |
tree | be7d24fd28dc797fb274b58f1b971ce0319b6dce /cmd-load-buffer.c | |
parent | 99946aaaafcd0fb38dd73f750739bb58f6822ed2 (diff) | |
download | rtmux-abea17afd9e85d88a14be0222d094c37ef7975b6.tar.gz rtmux-abea17afd9e85d88a14be0222d094c37ef7975b6.tar.bz2 rtmux-abea17afd9e85d88a14be0222d094c37ef7975b6.zip |
Buffer name can be NULL, check before strdup().
Diffstat (limited to 'cmd-load-buffer.c')
-rw-r--r-- | cmd-load-buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c index 2484bb66..8592ed39 100644 --- a/cmd-load-buffer.c +++ b/cmd-load-buffer.c @@ -73,7 +73,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item) if (strcmp(path, "-") == 0) { cdata = xcalloc(1, sizeof *cdata); cdata->item = item; - cdata->bufname = xstrdup(bufname); + + if (bufname != NULL) + cdata->bufname = xstrdup(bufname); error = server_set_stdin_callback(c, cmd_load_buffer_callback, cdata, &cause); |