From e83f039833e300814541933dccf6b3ab0a614695 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 12 May 2021 15:48:00 +1000 Subject: [PATCH] alsa: free the strdup'd substring on error n is the return value of pa_split() Found by scan-build --- spa/plugins/alsa/acp/alsa-mixer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spa/plugins/alsa/acp/alsa-mixer.c b/spa/plugins/alsa/acp/alsa-mixer.c index f581e71ba..947ac6f73 100644 --- a/spa/plugins/alsa/acp/alsa-mixer.c +++ b/spa/plugins/alsa/acp/alsa-mixer.c @@ -2553,6 +2553,7 @@ static int element_parse_override_map(pa_config_parser_state *state) { if (i >= (unsigned)channel_count) { pa_log("[%s:%u] Invalid override map size (>%d) in '%s'", state->filename, state->lineno, channel_count, state->section); + pa_xfree(n); return -1; } channel_position = alsa_channel_positions[i];