jack: fix double-free in finish routine
git-svn-id: https://svn.musicpd.org/mpd/trunk@5252 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
f894e98950
commit
3c2d123ab9
@ -64,6 +64,7 @@ static JackData *newJackData(void)
|
|||||||
static void jack_finishDriver(AudioOutput * audioOutput)
|
static void jack_finishDriver(AudioOutput * audioOutput)
|
||||||
{
|
{
|
||||||
JackData *jd = audioOutput->data;
|
JackData *jd = audioOutput->data;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (jd && jd->client) {
|
if (jd && jd->client) {
|
||||||
jack_deactivate(jd->client);
|
jack_deactivate(jd->client);
|
||||||
@ -71,9 +72,17 @@ static void jack_finishDriver(AudioOutput * audioOutput)
|
|||||||
}
|
}
|
||||||
ERROR("disconnect_jack (pid=%d)\n", getpid ());
|
ERROR("disconnect_jack (pid=%d)\n", getpid ());
|
||||||
|
|
||||||
if ( strcmp(name, "mpd") ) free(name);
|
if (strcmp(name, "mpd")) {
|
||||||
if ( output_ports[0] ) free(output_ports[0]);
|
free(name);
|
||||||
if ( output_ports[1] ) free(output_ports[1]);
|
name = "mpd";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = ARRAY_SIZE(output_ports); --i >= 0; ) {
|
||||||
|
if (!output_ports[i])
|
||||||
|
continue;
|
||||||
|
free(output_ports[i]);
|
||||||
|
output_ports[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (jd) {
|
if (jd) {
|
||||||
if (jd->ringbuffer[0])
|
if (jd->ringbuffer[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user