mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-15 00:02:36 +02:00
Add functions to allocate and free command contexts rather than doing it
all on the stack.
This commit is contained in:
@ -97,7 +97,7 @@ cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
|
||||
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
||||
if (guards)
|
||||
ctx->print(ctx, "%%begin");
|
||||
n = cmd_exec(cmd, ctx);
|
||||
n = cmd->entry->exec(cmd, ctx);
|
||||
if (guards)
|
||||
ctx->print(ctx, "%%end");
|
||||
|
||||
@ -146,7 +146,8 @@ cmd_list_free(struct cmd_list *cmdlist)
|
||||
while (!TAILQ_EMPTY(&cmdlist->list)) {
|
||||
cmd = TAILQ_FIRST(&cmdlist->list);
|
||||
TAILQ_REMOVE(&cmdlist->list, cmd, qentry);
|
||||
cmd_free(cmd);
|
||||
args_free(cmd->args);
|
||||
free(cmd);
|
||||
}
|
||||
free(cmdlist);
|
||||
}
|
||||
|
Reference in New Issue
Block a user