From f5c781b0d5755cb503a0531a159cd3664b32c620 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Feb 2014 17:43:38 +0100 Subject: command: remove special casing for strings in input commands Until now, strings were the only allowed dynamically allocated argument type in input commands. Extend it so that it works for any type. (The string expansion in command.c is of course still string specific.) --- player/command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index d27c3f4418..2a40132a70 100644 --- a/player/command.c +++ b/player/command.c @@ -2710,11 +2710,11 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (cmd->flags & MP_EXPAND_PROPERTIES) { for (int n = 0; n < cmd->nargs; n++) { if (cmd->args[n].type->type == CONF_TYPE_STRING) { - cmd->args[n].v.s = - mp_property_expand_string(mpctx, cmd->args[n].v.s); - if (!cmd->args[n].v.s) + char *s = mp_property_expand_string(mpctx, cmd->args[n].v.s); + if (!s) return; - talloc_steal(cmd, cmd->args[n].v.s); + talloc_free(cmd->args[n].v.s); + cmd->args[n].v.s = s; } } } -- cgit v1.2.3