audio: Fix memory leak when preprocessing is disabled

Change-Id: Ia168de215200ae9e1f4740cf5623b39058b3797c
tirimbino
Andreas Schneider 8 years ago
parent 8414bd240a
commit cabe5e6aef
  1. 19
      audio/audio_hw.c

@ -4000,6 +4000,16 @@ static void adev_close_input_stream(struct audio_hw_device *dev,
/* prevent concurrent out_set_parameters, or out_write from standby */
pthread_mutex_lock(&adev->lock_inputs);
if (in->read_buf) {
free(in->read_buf);
in->read_buf = NULL;
}
if (in->resampler) {
release_resampler(in->resampler);
in->resampler = NULL;
}
#ifdef PREPROCESSING_ENABLED
int i;
@ -4007,11 +4017,6 @@ static void adev_close_input_stream(struct audio_hw_device *dev,
free(in->preprocessors[i].channel_configs);
}
if (in->read_buf) {
free(in->read_buf);
in->read_buf = NULL;
}
if (in->proc_buf_in) {
free(in->proc_buf_in);
in->proc_buf_in = NULL;
@ -4027,10 +4032,6 @@ static void adev_close_input_stream(struct audio_hw_device *dev,
in->ref_buf = NULL;
}
if (in->resampler) {
release_resampler(in->resampler);
in->resampler = NULL;
}
#endif
in_standby_l(in);

Loading…
Cancel
Save