From: Jaroslav Kysela Date: Fri, 18 Jun 2021 08:11:34 +0000 (+0200) Subject: alsatplg: fix memory-leak in tplg_construct_object_name() X-Git-Tag: v1.2.6~40 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=0b8d2dfdcca767c833f302b22b36bc09cfb2a74a;p=alsa-utils.git alsatplg: fix memory-leak in tplg_construct_object_name() Signed-off-by: Jaroslav Kysela --- diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c index 7565091..ff985e7 100644 --- a/topology/pre-process-object.c +++ b/topology/pre-process-object.c @@ -1290,13 +1290,13 @@ static int tplg_construct_object_name(struct tplg_pre_processor *tplg_pp, snd_co /* alloc and concat arg value to the name */ temp = tplg_snprintf("%s.%s", new_name, arg_value); + free(arg_value); if (!temp) { ret = -ENOMEM; goto err; } free(new_name); new_name = temp; - free(arg_value); } ret = snd_config_set_id(obj, new_name);