UPSTREAM: libmbim-glib,device: fix double error free when processing device services query

==84574== Invalid free() / delete / delete[] / realloc()
  ==84574==    at 0x484426F: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==84574==    by 0x4CEAB75: g_error_free (gerror.c:853)
  ==84574==    by 0x49E5903: glib_autoptr_clear_GError (glib-autocleanups.h:52)
  ==84574==    by 0x49E5903: glib_autoptr_cleanup_GError (glib-autocleanups.h:52)
  ==84574==    by 0x49E5903: device_services_message_ready (mbim-device.c:1730)
  ==84574==    by 0x4B24503: g_task_return_now (gtask.c:1230)
  ==84574==    by 0x4B281BC: UnknownInlinedFun (gtask.c:1299)
  ==84574==    by 0x4B281BC: g_task_return (gtask.c:1256)
  ==84574==    by 0x49E23B2: transaction_task_complete_and_free (mbim-device.c:253)
  ==84574==    by 0x49E2977: transaction_timed_out (mbim-device.c:335)
  ==84574==    by 0x4CFF336: g_timeout_dispatch (gmain.c:4971)
  ==84574==    by 0x4CFEB2A: UnknownInlinedFun (gmain.c:3417)
  ==84574==    by 0x4CFEB2A: g_main_context_dispatch (gmain.c:4135)
  ==84574==    by 0x4D54E78: g_main_context_iterate.constprop.0 (gmain.c:4211)
  ==84574==    by 0x4CFE08E: g_main_loop_run (gmain.c:4411)
  ==84574==    by 0x1422A6: main (in /usr/bin/ModemManager)
  ==84574==  Address 0x8b0d810 is 0 bytes inside a block of size 22 free'd
  ==84574==    at 0x484426F: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==84574==    by 0x4CEAB75: g_error_free (gerror.c:853)
  ==84574==    by 0x4CEAD3A: g_clear_error (gerror.c:1052)
  ==84574==    by 0x1D8526: mbim_port_open_ready (in /usr/bin/ModemManager)
  ==84574==    by 0x4B24503: g_task_return_now (gtask.c:1230)
  ==84574==    by 0x4B281BC: UnknownInlinedFun (gtask.c:1299)
  ==84574==    by 0x4B281BC: g_task_return (gtask.c:1256)
  ==84574==    by 0x217BB6: mbim_device_open_ready (in /usr/bin/ModemManager)
  ==84574==    by 0x4B24503: g_task_return_now (gtask.c:1230)
  ==84574==    by 0x4B281BC: UnknownInlinedFun (gtask.c:1299)
  ==84574==    by 0x4B281BC: g_task_return (gtask.c:1256)
  ==84574==    by 0x49E58DD: device_services_message_ready (mbim-device.c:1748)
  ==84574==    by 0x4B24503: g_task_return_now (gtask.c:1230)
  ==84574==    by 0x4B281BC: UnknownInlinedFun (gtask.c:1299)
  ==84574==    by 0x4B281BC: g_task_return (gtask.c:1256)
  ==84574==  Block was alloc'd at
  ==84574==    at 0x4841888: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==84574==    by 0x4D079D9: g_malloc (gmem.c:125)
  ==84574==    by 0x4D1CB44: g_strdup (gstrfuncs.c:361)
  ==84574==    by 0x4CEA832: g_error_copy (gerror.c:892)
  ==84574==    by 0x49E23A7: transaction_task_complete_and_free (mbim-device.c:253)
  ==84574==    by 0x49E2977: transaction_timed_out (mbim-device.c:335)
  ==84574==    by 0x4CFF336: g_timeout_dispatch (gmain.c:4971)
  ==84574==    by 0x4CFEB2A: UnknownInlinedFun (gmain.c:3417)
  ==84574==    by 0x4CFEB2A: g_main_context_dispatch (gmain.c:4135)
  ==84574==    by 0x4D54E78: g_main_context_iterate.constprop.0 (gmain.c:4211)
  ==84574==    by 0x4CFE08E: g_main_loop_run (gmain.c:4411)
  ==84574==    by 0x1422A6: main (in /usr/bin/ModemManager)

Upstream-ff18aba86d7e752b76f7a45e6e7b41b639126ee7-SHA1
BUG=b:246986421
TEST=None

Change-Id: I842b70bfad27f455cb596194ab0e8ebdaef948bf
(cherry picked from commit 1025a316d0d63faaeb794c9254f242a1a27a1830)
1 file changed
tree: 154c9b72f5925b80195fe72b127e30213388ccb5
  1. build-aux/
  2. data/
  3. docs/
  4. examples/
  5. LICENSES/
  6. src/
  7. utils/
  8. .gitignore
  9. .gitlab-ci.yml
  10. AUTHORS
  11. meson.build
  12. meson_options.txt
  13. NEWS
  14. OWNERS
  15. README.chromium
  16. README.md
  17. RELEASING
  18. unblocked_terms.txt
README.md

libmbim

libmbim is a glib-based library for talking to WWAN modems and devices which speak the Mobile Broadband Interface Model (MBIM) protocol.

Documentation

Project documentation is kept in: https://modemmanager.org/docs/libmbim/

License

  • libmbim-glib library is released under the LGPL-2.1-or-later license.
  • mbimcli and mbim-network tools are released under the GPL-2.0-or-later license.

License texts can be found under the LICENSES folder.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms, which you can find in the following link: https://www.freedesktop.org/wiki/CodeOfConduct CoC issues may be raised to the project maintainers at the following address: libmbim-devel-owner@lists.freedesktop.org