diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-05-19 13:29:34 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-05-19 13:30:32 +0200 |
commit | 7de4d6673bb5fd0e4ab36ce195b25bb5a20b4a9b (patch) | |
tree | d5e3437b12e80fd2dd333ec1258a7230d22914d9 /src | |
parent | 2788c6c5f61c6e314e65ad1057ae5361b5812e83 (diff) |
broadband-modem-mbim: plug memleak when MBIMEx v2 not supported
==11025== 40 bytes in 1 blocks are definitely lost in loss record 3,313 of 5,483
==11025== at 0x483E7C5: malloc (vg_replace_malloc.c:380)
==11025== by 0x4A32CA9: g_malloc (in /usr/lib/libglib-2.0.so.0.7000.2)
==11025== by 0x4A4A082: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.7000.2)
==11025== by 0x49F8574: g_array_sized_new (in /usr/lib/libglib-2.0.so.0.7000.2)
==11025== by 0x24DEB1: load_supported_modes_mbim (mm-broadband-modem-mbim.c:958)
==11025== by 0x24E2D5: modem_load_supported_modes (mm-broadband-modem-mbim.c:1042)
==11025== by 0x1D4DC5: interface_initialization_step (mm-iface-modem.c:5718)
==11025== by 0x1D26D6: load_device_identifier_ready (mm-iface-modem.c:4903)
==11025== by 0x4BACB83: ??? (in /usr/lib/libgio-2.0.so.0.7000.2)
==11025== by 0x4BACBB8: ??? (in /usr/lib/libgio-2.0.so.0.7000.2)
==11025== by 0x4A2A434: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.7000.2)
==11025== by 0x4A7E7B8: ??? (in /usr/lib/libglib-2.0.so.0.7000.2)
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem-mbim.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index b8c5617c..ead9849d 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -929,7 +929,6 @@ load_supported_modes_mbim (GTask *task, { MMBroadbandModemMbim *self; GArray *all; - GArray *combinations; GArray *filtered; MMModemMode mask_all; MMModemModeCombination mode = { @@ -955,12 +954,14 @@ load_supported_modes_mbim (GTask *task, all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); g_array_append_val (all, mode); - combinations = g_array_new (FALSE, FALSE, sizeof (MMModemModeCombination)); - /* When using MBIMEx we can enable the mode switching operation because * we'll be able to know if the modes requested are the ones configured * as preferred after the operation. */ if (mbim_device_check_ms_mbimex_version (device, 2, 0)) { + GArray *combinations; + + combinations = g_array_new (FALSE, FALSE, sizeof (MMModemModeCombination)); + #define ADD_MODE_PREFERENCE(MODE_MASK) do { \ mode.allowed = MODE_MASK; \ mode.preferred = MM_MODEM_MODE_NONE; \ |