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)
This commit is contained in:
@@ -929,7 +929,6 @@ load_supported_modes_mbim (GTask *task,
|
|||||||
{
|
{
|
||||||
MMBroadbandModemMbim *self;
|
MMBroadbandModemMbim *self;
|
||||||
GArray *all;
|
GArray *all;
|
||||||
GArray *combinations;
|
|
||||||
GArray *filtered;
|
GArray *filtered;
|
||||||
MMModemMode mask_all;
|
MMModemMode mask_all;
|
||||||
MMModemModeCombination mode = {
|
MMModemModeCombination mode = {
|
||||||
@@ -955,12 +954,14 @@ load_supported_modes_mbim (GTask *task,
|
|||||||
all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
|
all = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1);
|
||||||
g_array_append_val (all, mode);
|
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
|
/* 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
|
* we'll be able to know if the modes requested are the ones configured
|
||||||
* as preferred after the operation. */
|
* as preferred after the operation. */
|
||||||
if (mbim_device_check_ms_mbimex_version (device, 2, 0)) {
|
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 { \
|
#define ADD_MODE_PREFERENCE(MODE_MASK) do { \
|
||||||
mode.allowed = MODE_MASK; \
|
mode.allowed = MODE_MASK; \
|
||||||
mode.preferred = MM_MODEM_MODE_NONE; \
|
mode.preferred = MM_MODEM_MODE_NONE; \
|
||||||
|
Reference in New Issue
Block a user