From 6827901230a962ef40fbc18c6ab25d4d702b95aa Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 18 Jan 2018 10:08:48 +0100 Subject: ta: introduce talloc_dup() and use it in some places It was actually already implemented as ta_dup_ptrtype(), but that seems like a clunky name. Also we still use the talloc_ names throughout the source, and I'd rather use an old name instead of a mixing inconsistent naming conventions. --- input/cmd_parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'input/cmd_parse.c') diff --git a/input/cmd_parse.c b/input/cmd_parse.c index c4ac9dd6b7..c5f428e23d 100644 --- a/input/cmd_parse.c +++ b/input/cmd_parse.c @@ -356,7 +356,7 @@ mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc) talloc_steal(list, cmd); struct mp_cmd_arg arg = {0}; arg.v.p = cmd; - list->args = talloc_memdup(list, &arg, sizeof(arg)); + list->args = talloc_dup(list, &arg); p_prev = &cmd->queue_next; cmd = list; } @@ -406,7 +406,7 @@ mp_cmd_t *mp_cmd_clone(mp_cmd_t *cmd) if (!cmd) return NULL; - ret = talloc_memdup(NULL, cmd, sizeof(mp_cmd_t)); + ret = talloc_dup(NULL, cmd); talloc_set_destructor(ret, destroy_cmd); ret->name = talloc_strdup(ret, cmd->name); ret->args = talloc_zero_array(ret, struct mp_cmd_arg, ret->nargs); @@ -427,7 +427,7 @@ mp_cmd_t *mp_cmd_clone(mp_cmd_t *cmd) } else { struct mp_cmd_arg arg = {0}; arg.v.p = sub; - ret->args = talloc_memdup(ret, &arg, sizeof(arg)); + ret->args = talloc_dup(ret, &arg); } prev = sub; } -- cgit v1.2.3