mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
raop: Fix potential resource leaks
Coverity ID: #1410204, #1410203, #1410202, #1410201, #1410200, #1410199 Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
This commit is contained in:
parent
6c35ac7c8f
commit
233cb4516a
1 changed files with 10 additions and 4 deletions
|
|
@ -177,6 +177,7 @@ static void resolver_cb(
|
|||
* - TCP = only TCP,
|
||||
* - UDP = only UDP,
|
||||
* - TCP,UDP = both supported (UDP should be prefered) */
|
||||
pa_xfree(tp);
|
||||
if (pa_str_in_list(value, ",", "UDP"))
|
||||
tp = pa_xstrdup("UDP");
|
||||
else if (pa_str_in_list(value, ",", "TCP"))
|
||||
|
|
@ -190,16 +191,18 @@ static void resolver_cb(
|
|||
* - 2 = FairPlay,
|
||||
* - 3 = MFiSAP,
|
||||
* - 4 = FairPlay SAPv2.5. */
|
||||
if (pa_str_in_list(value, ",", "1"))
|
||||
et = pa_xstrdup("RSA");
|
||||
else
|
||||
et = pa_xstrdup("none");
|
||||
pa_xfree(et);
|
||||
if (pa_str_in_list(value, ",", "1"))
|
||||
et = pa_xstrdup("RSA");
|
||||
else
|
||||
et = pa_xstrdup("none");
|
||||
} else if (pa_streq(key, "cn")) {
|
||||
/* Suported audio codecs:
|
||||
* - 0 = PCM,
|
||||
* - 1 = ALAC,
|
||||
* - 2 = AAC,
|
||||
* - 3 = AAC ELD. */
|
||||
pa_xfree(cn);
|
||||
if (pa_str_in_list(value, ",", "1"))
|
||||
cn = pa_xstrdup("ALAC");
|
||||
else
|
||||
|
|
@ -213,12 +216,15 @@ static void resolver_cb(
|
|||
/* Requires password ? (true/false) */
|
||||
} else if (pa_streq(key, "ch")) {
|
||||
/* Number of channels */
|
||||
pa_xfree(ch);
|
||||
ch = pa_xstrdup(value);
|
||||
} else if (pa_streq(key, "ss")) {
|
||||
/* Sample size */
|
||||
pa_xfree(ss);
|
||||
ss = pa_xstrdup(value);
|
||||
} else if (pa_streq(key, "sr")) {
|
||||
/* Sample rate */
|
||||
pa_xfree(sr);
|
||||
sr = pa_xstrdup(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue