diff options
author | Jaroslav Kysela <perex@perex.cz> | 2022-05-13 16:19:48 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2022-05-13 16:19:50 +0200 |
commit | 3e5a8943781d17361ffe79e03c23e76946fcd67f (patch) | |
tree | 186ecfc2b3de829a97fd0e6beff5d3f02bf4e1fa | |
parent | 50140120c696bec133f418a144b1ff609254ab4b (diff) | |
download | alsa-lib-3e5a8943781d17361ffe79e03c23e76946fcd67f.tar.gz |
conf: fix memory leak in snd_config_substitute() for strings
When destination type is SND_CONFIG_TYPE_STRING, the old string
must be freed.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | src/conf.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1741,6 +1741,8 @@ int snd_config_substitute(snd_config_t *dst, snd_config_t *src) src->u.compound.fields.prev->next = &dst->u.compound.fields; } free(dst->id); + if (dst->type == SND_CONFIG_TYPE_STRING) + free(dst->u.string); dst->id = src->id; dst->type = src->type; dst->u = src->u; |