aboutsummaryrefslogtreecommitdiff
path: root/cmd-if-shell.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-04-22 08:01:54 +0100
committerThomas Adam <thomas@xteddy.org>2017-04-22 08:01:54 +0100
commitd8398af77033519b21258893927deeaa1208c17e (patch)
tree4807bb2c0ba5703866a4a3e1fa1bbf02f977e782 /cmd-if-shell.c
parent21240c1a8f89a4615b5bd8fa129618fb45c1c3cb (diff)
parent30348edc7c0e3fd7afa545efbe48cdad69102e65 (diff)
downloadrtmux-d8398af77033519b21258893927deeaa1208c17e.tar.gz
rtmux-d8398af77033519b21258893927deeaa1208c17e.tar.bz2
rtmux-d8398af77033519b21258893927deeaa1208c17e.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r--cmd-if-shell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index fafb8cee..4a93885b 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -120,7 +120,8 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
cdata->cmd_else = NULL;
cdata->client = item->client;
- cdata->client->references++;
+ if (cdata->client != NULL)
+ cdata->client->references++;
if (!args_has(args, 'b'))
cdata->item = item;
@@ -193,7 +194,8 @@ cmd_if_shell_free(void *data)
{
struct cmd_if_shell_data *cdata = data;
- server_client_unref(cdata->client);
+ if (cdata->client != NULL)
+ server_client_unref(cdata->client);
free(cdata->cmd_else);
free(cdata->cmd_if);