Re: memory leak in mix/pcm_upmix.c mix/pcm_downmix.c!!!

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

 



i notice some ioplug plugin does free. but most extplug plugin do NOT free
pointer  allocated at open function.

2017-08-30 13:51 GMT+08:00 boozer asm <asmboozer@xxxxxxxxx>:

> eg.
> in function:SND_PCM_PLUGIN_DEFINE_FUNC(upmix)
> 487     mix = calloc(1, sizeof(*mix));
> 488     if (mix == NULL)
> 489         return -ENOMEM;
>
> mix is allocated here. but at close function, it is not freed, and no
> __destructor function available to free it.
>
> and in alsa-lib/src/pcm/pcm_extplug.c
> static int snd_pcm_extplug_close(snd_pcm_t *pcm)
> {
>     extplug_priv_t *ext = pcm->private_data;
>
>     snd_pcm_close(ext->plug.gen.slave);
>     clear_ext_params(ext);
>     if (ext->data->callback->close)
>     {
>         ext->data->callback->close(ext->data);
>     }
>     free(ext);
>     return 0;
> }
> this function does NOT free ext->data.
> and
> 366 static int upmix_close(snd_pcm_extplug_t *ext)
> 367 {
> 368     snd_pcm_upmix_t *mix = (snd_pcm_upmix_t *)ext;
> 369     free(mix->delayline[0]);
> 370     free(mix->delayline[1]);
> 371     return 0;
> 372 }
>
> and this function does NOT free mix itself.
>
> so I think there is memory leak.
>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux