resampler: Fix a memory leak in pa_resampler_ffmpeg_init()

ffmpeg_data was not freed properly before return due to error.
It is now freed properly.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=95347

Signed-off-by: Sachin Kumar Chauhan <sachin.kc@samsung.com>
Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
Sachin Kumar Chauhan 2016-05-13 14:16:16 +05:30 committed by Arun Raghavan
parent 47a0171a95
commit 6603ee8563

View file

@ -119,8 +119,10 @@ int pa_resampler_ffmpeg_init(pa_resampler *r) {
* internally only uses these hardcoded values, so let's use them
* here for now as well until ffmpeg makes this configurable. */
if (!(ffmpeg_data->state = av_resample_init((int) r->o_ss.rate, (int) r->i_ss.rate, 16, 10, 0, 0.8)))
if (!(ffmpeg_data->state = av_resample_init((int) r->o_ss.rate, (int) r->i_ss.rate, 16, 10, 0, 0.8))) {
pa_xfree(ffmpeg_data);
return -1;
}
r->impl.free = ffmpeg_free;
r->impl.resample = ffmpeg_resample;