[PATCH] bearer-qmi: replace g_new + memcpy with g_memdup
Aleksander Morgado
aleksander at aleksander.es
Tue Jul 11 09:37:35 UTC 2017
On 10/07/17 20:20, Ben Chan wrote:
> ---
> src/mm-bearer-qmi.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
Pushed to git master, thanks.
> diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
> index 4d532274..c687db60 100644
> --- a/src/mm-bearer-qmi.c
> +++ b/src/mm-bearer-qmi.c
> @@ -151,7 +151,6 @@ reload_stats_context_step (GTask *task)
> {
> MMBearerQmi *self;
> ReloadStatsContext *ctx;
> - ReloadStatsResult *stats;
>
> self = g_task_get_source_object (task);
> ctx = g_task_get_task_data (task);
> @@ -185,9 +184,9 @@ reload_stats_context_step (GTask *task)
> ctx->step++;
> /* Fall through */
> case RELOAD_STATS_CONTEXT_STEP_LAST:
> - stats = g_new (ReloadStatsResult, 1);
> - memcpy (stats, &ctx->stats, sizeof (ctx->stats));
> - g_task_return_pointer (task, stats, g_free);
> + g_task_return_pointer (task,
> + g_memdup (&ctx->stats, sizeof (ctx->stats)),
> + g_free);
> g_object_unref (task);
> return;
> }
>
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list