[PATCH] Resampler: Fix a memory leak in pa_resampler_ffmpeg_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 May 2016, at 02:16 PM, Sachin Kumar Chauhan wrote:
> 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 at samsung.com>
> ---
>  src/pulsecore/resampler/ffmpeg.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/pulsecore/resampler/ffmpeg.c
> b/src/pulsecore/resampler/ffmpeg.c
> index 691bdd4..598af42 100644
> --- a/src/pulsecore/resampler/ffmpeg.c
> +++ b/src/pulsecore/resampler/ffmpeg.c
> @@ -120,7 +120,10 @@ int pa_resampler_ffmpeg_init(pa_resampler *r) {
>       * 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)))
> +    {
> +        pa_xfree(ffmpeg_data);
>          return -1;
> +    }

Pushed with some style changes. Please see the differences and keep them
in mind for future patches.

-- Arun


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux