[pulseaudio-discuss] [PATCH 6/8] modules: Fix entry leak in module-card-restore

Arun Raghavan arun at accosted.net
Mon Sep 14 21:23:27 PDT 2015


On Mon, 2015-09-14 at 18:07 +0200, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
> CID 1323585
> 
> entry_read() allocates an entry which must be freed
> ---
>  src/modules/module-card-restore.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/modules/module-card-restore.c b/src/modules/module
> -card-restore.c
> index eb6c94a..197335a 100644
> --- a/src/modules/module-card-restore.c
> +++ b/src/modules/module-card-restore.c
> @@ -445,6 +445,7 @@ static pa_hook_result_t
> profile_available_changed_callback(void *hook_data, void
>      if (pa_card_set_profile(profile->card, profile, true) != 0)
>          pa_log_warn("Could not set profile '%s'", profile->name);
>  
> +    entry_free(entry);
>      return PA_HOOK_OK;
>  }
>  

This one is incomplete. We also need to free the entry in the condition
before this snippet (profile name comparison).

-- Arun


More information about the pulseaudio-discuss mailing list