android/hal-sco: Fix memory leak

Release resampler on exit.
This commit is contained in:
Andrei Emeltchenko 2014-05-22 15:06:05 +03:00 committed by Luiz Augusto von Dentz
parent cc3dd149f8
commit 3c5413c3dd

View File

@ -617,6 +617,9 @@ static int sco_open_output_stream(struct audio_hw_device *dev,
return 0;
failed:
if (out->resampler)
release_resampler(out->resampler);
free(out->downmix_buf);
free(out);
stream_out = NULL;
@ -638,6 +641,9 @@ static void sco_close_output_stream(struct audio_hw_device *dev,
sco_dev->out->fd = -1;
}
if (out->resampler)
release_resampler(out->resampler);
free(out->downmix_buf);
free(out);
sco_dev->out = NULL;