diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-10-25 12:01:10 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-10-25 12:01:10 +0100 |
commit | dafd6f462fa3b90c97d0e6ecd887c62cbc2a54c3 (patch) | |
tree | cb92edd2c09ac281e1d1034fcdd646f0a4e8dc17 | |
parent | 5ce34add77fa3517a01e63b915c5f4e3241af470 (diff) | |
parent | 2111142cf1715eeac174cd5c71ed90f00595b17e (diff) | |
download | rtmux-dafd6f462fa3b90c97d0e6ecd887c62cbc2a54c3.tar.gz rtmux-dafd6f462fa3b90c97d0e6ecd887c62cbc2a54c3.tar.bz2 rtmux-dafd6f462fa3b90c97d0e6ecd887c62cbc2a54c3.zip |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-parse.y | 3 | ||||
-rw-r--r-- | screen-write.c | 18 |
2 files changed, 14 insertions, 7 deletions
diff --git a/cmd-parse.y b/cmd-parse.y index 1d692770..cdf026f3 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -1086,7 +1086,8 @@ cmd_parse_from_arguments(struct args_value *values, u_int count, arg->type = CMD_PARSE_STRING; arg->string = copy; TAILQ_INSERT_TAIL(&cmd->arguments, arg, entry); - } + } else + free(copy); } else if (values[i].type == ARGS_COMMANDS) { arg = xcalloc(1, sizeof *arg); arg->type = CMD_PARSE_PARSED_COMMANDS; diff --git a/screen-write.c b/screen-write.c index 476fe4dd..a2107f2a 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1505,8 +1505,10 @@ screen_write_fullredraw(struct screen_write_ctx *ctx) screen_write_collect_flush(ctx, 0, __func__); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } /* Trim collected items. */ @@ -2127,8 +2129,10 @@ screen_write_alternateon(struct screen_write_ctx *ctx, struct grid_cell *gc, screen_write_collect_flush(ctx, 0, __func__); screen_alternate_on(ctx->s, gc, cursor); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } /* Turn alternate screen off. */ @@ -2145,6 +2149,8 @@ screen_write_alternateoff(struct screen_write_ctx *ctx, struct grid_cell *gc, screen_write_collect_flush(ctx, 0, __func__); screen_alternate_off(ctx->s, gc, cursor); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } |