base-modem: fix double GError free during quick sync

==10719== Invalid free() / delete / delete[] / realloc()
  ==10719==    at 0x4897D88: free (vg_replace_malloc.c:872)
  ==10719==    by 0x52F091B: g_free (gmem.c:220)
  ==10719==    by 0x530C36B: g_slice_free1 (gslice.c:1185)
  ==10719==    by 0x52D632B: g_error_free (gerror.c:872)
  ==10719==    by 0x192DBF: UnknownInlinedFun (glib-autocleanups.h:54)
  ==10719==    by 0x192DBF: UnknownInlinedFun (glib-autocleanups.h:54)
  ==10719==    by 0x192DBF: sync_ready (mm-base-modem.c:671)
  ==10719==    by 0x50A82CB: g_task_return_now (gtask.c:1232)
  ==10719==    by 0x50A854B: UnknownInlinedFun (gtask.c:1301)
  ==10719==    by 0x50A854B: g_task_return (gtask.c:1258)
  ==10719==    by 0x50AAA4F: g_task_return_new_error (gtask.c:1944)
  ==10719==    by 0x1F44E3: iface_modem_sync_ready (mm-broadband-modem.c:12205)
  ==10719==    by 0x50A82CB: g_task_return_now (gtask.c:1232)
  ==10719==    by 0x50A854B: UnknownInlinedFun (gtask.c:1301)
  ==10719==    by 0x50A854B: g_task_return (gtask.c:1258)
  ==10719==    by 0x1AB86B: interface_syncing_step.lto_priv.0 (mm-iface-modem.c:4644)
  ==10719==  Address 0x910bf30 is 0 bytes inside a block of size 16 free'd
  ==10719==    at 0x4897D88: free (vg_replace_malloc.c:872)
  ==10719==    by 0x52F091B: g_free (gmem.c:220)
  ==10719==    by 0x530C36B: g_slice_free1 (gslice.c:1185)
  ==10719==    by 0x52D632B: g_error_free (gerror.c:872)
  ==10719==    by 0x17565F: UnknownInlinedFun (glib-autocleanups.h:54)
  ==10719==    by 0x17565F: UnknownInlinedFun (glib-autocleanups.h:54)
  ==10719==    by 0x17565F: base_modem_sync_ready (mm-base-manager.c:737)
  ==10719==    by 0x50A82CB: g_task_return_now (gtask.c:1232)
  ==10719==    by 0x50A854B: UnknownInlinedFun (gtask.c:1301)
  ==10719==    by 0x50A854B: g_task_return (gtask.c:1258)
  ==10719==    by 0x192DAB: sync_ready (mm-base-modem.c:674)
  ==10719==    by 0x50A82CB: g_task_return_now (gtask.c:1232)
  ==10719==    by 0x50A854B: UnknownInlinedFun (gtask.c:1301)
  ==10719==    by 0x50A854B: g_task_return (gtask.c:1258)
  ==10719==    by 0x50AAA4F: g_task_return_new_error (gtask.c:1944)
  ==10719==    by 0x1F44E3: iface_modem_sync_ready (mm-broadband-modem.c:12205)
  ==10719==  Block was alloc'd at
  ==10719==    at 0x48952CC: malloc (vg_replace_malloc.c:381)
  ==10719==    by 0x52F3EF3: g_malloc (gmem.c:127)
  ==10719==    by 0x530CD27: g_slice_alloc (gslice.c:1074)
  ==10719==    by 0x530D2B7: g_slice_alloc0 (gslice.c:1100)
  ==10719==    by 0x52D5E7B: g_error_allocate (gerror.c:710)
  ==10719==    by 0x52D690F: UnknownInlinedFun (gerror.c:724)
  ==10719==    by 0x52D690F: g_error_new_valist (gerror.c:766)
  ==10719==    by 0x50AAA43: g_task_return_new_error (gtask.c:1941)
  ==10719==    by 0x1F44E3: iface_modem_sync_ready (mm-broadband-modem.c:12205)
  ==10719==    by 0x50A82CB: g_task_return_now (gtask.c:1232)
  ==10719==    by 0x50A854B: UnknownInlinedFun (gtask.c:1301)
  ==10719==    by 0x50A854B: g_task_return (gtask.c:1258)
  ==10719==    by 0x1AB86B: interface_syncing_step.lto_priv.0 (mm-iface-modem.c:4644)
  ==10719==    by 0x1AB9A3: UnknownInlinedFun (mm-iface-modem.c:4543)
  ==10719==    by 0x1AB9A3: interface_syncing_step.lto_priv.0 (mm-iface-modem.c:4639)
This commit is contained in:
Aleksander Morgado
2022-08-25 13:36:58 +00:00
parent ff7e062e94
commit ec50f14807

View File

@@ -668,7 +668,7 @@ sync_ready (MMBaseModem *self,
GAsyncResult *res,
GTask *task)
{
g_autoptr(GError) error = NULL;
GError *error = NULL;
if (!MM_BASE_MODEM_GET_CLASS (self)->sync_finish (self, res, &error))
g_task_return_error (task, error);