[PATCH 1/2] wavecom: fix memory leak

Aleksander Morgado aleksander at aleksander.es
Sat Oct 7 08:03:11 UTC 2017


On 07/10/17 03:05, Ben Chan wrote:
> ---
>  plugins/wavecom/mm-broadband-modem-wavecom.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Pushed to git master, thanks!

> diff --git a/plugins/wavecom/mm-broadband-modem-wavecom.c b/plugins/wavecom/mm-broadband-modem-wavecom.c
> index 94115408..5da6c232 100644
> --- a/plugins/wavecom/mm-broadband-modem-wavecom.c
> +++ b/plugins/wavecom/mm-broadband-modem-wavecom.c
> @@ -305,13 +305,14 @@ wwsm_read_ready (MMBaseModem  *self,
>          }
>      }
>  
> -    if (result->allowed == MM_MODEM_MODE_NONE)
> +    if (result->allowed == MM_MODEM_MODE_NONE) {
>          g_task_return_new_error (task,
>                                   MM_CORE_ERROR,
>                                   MM_CORE_ERROR_FAILED,
>                                   "Unknown wireless data service reply: '%s'",
>                                   response);
> -    else
> +        g_free (result);
> +    } else
>          g_task_return_pointer (task, result, g_free);
>      g_object_unref (task);
>  
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list