From 9a341c6b3615eda849c4a6ab58e8b0c4eee6bd8d Mon Sep 17 00:00:00 2001
From: Peter Meerwald
Date: Mon, 16 Dec 2013 16:25:44 +0100
Subject: [PATCH] modules: Fix resource leak in alsa-ucm
https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8833&defectInstanceId=3732&mergedDefectId=591268
Signed-off-by: Peter Meerwald
---
src/modules/alsa/alsa-ucm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index c88fc776..23522c78 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -1106,8 +1106,7 @@ static void alsa_mapping_add_ucm_modifier(pa_alsa_mapping *m, pa_alsa_ucm_modifi
m->description = pa_xstrdup(new_desc);
pa_xfree(cur_desc);
- if (!m->description)
- pa_xstrdup("");
+ m->description = m->description ? m->description : pa_xstrdup("");
/* Modifier sinks should not be routed to by default */
m->priority = 0;
--
2.39.2