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,
|
* - TCP = only TCP,
|
||||||
* - UDP = only UDP,
|
* - UDP = only UDP,
|
||||||
* - TCP,UDP = both supported (UDP should be prefered) */
|
* - TCP,UDP = both supported (UDP should be prefered) */
|
||||||
|
pa_xfree(tp);
|
||||||
if (pa_str_in_list(value, ",", "UDP"))
|
if (pa_str_in_list(value, ",", "UDP"))
|
||||||
tp = pa_xstrdup("UDP");
|
tp = pa_xstrdup("UDP");
|
||||||
else if (pa_str_in_list(value, ",", "TCP"))
|
else if (pa_str_in_list(value, ",", "TCP"))
|
||||||
|
|
@ -190,16 +191,18 @@ static void resolver_cb(
|
||||||
* - 2 = FairPlay,
|
* - 2 = FairPlay,
|
||||||
* - 3 = MFiSAP,
|
* - 3 = MFiSAP,
|
||||||
* - 4 = FairPlay SAPv2.5. */
|
* - 4 = FairPlay SAPv2.5. */
|
||||||
if (pa_str_in_list(value, ",", "1"))
|
pa_xfree(et);
|
||||||
et = pa_xstrdup("RSA");
|
if (pa_str_in_list(value, ",", "1"))
|
||||||
else
|
et = pa_xstrdup("RSA");
|
||||||
et = pa_xstrdup("none");
|
else
|
||||||
|
et = pa_xstrdup("none");
|
||||||
} else if (pa_streq(key, "cn")) {
|
} else if (pa_streq(key, "cn")) {
|
||||||
/* Suported audio codecs:
|
/* Suported audio codecs:
|
||||||
* - 0 = PCM,
|
* - 0 = PCM,
|
||||||
* - 1 = ALAC,
|
* - 1 = ALAC,
|
||||||
* - 2 = AAC,
|
* - 2 = AAC,
|
||||||
* - 3 = AAC ELD. */
|
* - 3 = AAC ELD. */
|
||||||
|
pa_xfree(cn);
|
||||||
if (pa_str_in_list(value, ",", "1"))
|
if (pa_str_in_list(value, ",", "1"))
|
||||||
cn = pa_xstrdup("ALAC");
|
cn = pa_xstrdup("ALAC");
|
||||||
else
|
else
|
||||||
|
|
@ -213,12 +216,15 @@ static void resolver_cb(
|
||||||
/* Requires password ? (true/false) */
|
/* Requires password ? (true/false) */
|
||||||
} else if (pa_streq(key, "ch")) {
|
} else if (pa_streq(key, "ch")) {
|
||||||
/* Number of channels */
|
/* Number of channels */
|
||||||
|
pa_xfree(ch);
|
||||||
ch = pa_xstrdup(value);
|
ch = pa_xstrdup(value);
|
||||||
} else if (pa_streq(key, "ss")) {
|
} else if (pa_streq(key, "ss")) {
|
||||||
/* Sample size */
|
/* Sample size */
|
||||||
|
pa_xfree(ss);
|
||||||
ss = pa_xstrdup(value);
|
ss = pa_xstrdup(value);
|
||||||
} else if (pa_streq(key, "sr")) {
|
} else if (pa_streq(key, "sr")) {
|
||||||
/* Sample rate */
|
/* Sample rate */
|
||||||
|
pa_xfree(sr);
|
||||||
sr = pa_xstrdup(value);
|
sr = pa_xstrdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue