broadband-modem: plug memleak when listing profiles

==4263== 747 (72 direct, 675 indirect) bytes in 3 blocks are definitely lost in loss record 5,739 of 5,787
  ==4263==    at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==4263==    by 0x50C6DE8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x50DDFF1: g_slice_alloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x50B8EB9: g_list_prepend (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==4263==    by 0x27CE4C: mm_3gpp_parse_cgdcont_read_response (mm-modem-helpers.c:1845)
  ==4263==    by 0x1E5485: profile_manager_cgdcont_query_ready (mm-broadband-modem.c:10200)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x18605E: at_command_ready (mm-base-modem-at.c:538)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x25ADFA: serial_command_ready (mm-port-serial-at.c:393)
  ==4263==    by 0x4ED54A1: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==4263==    by 0x254752: command_context_complete_and_free (mm-port-serial.c:141)
This commit is contained in:
Aleksander Morgado
2021-06-17 15:56:41 +02:00
parent 4c5733e49b
commit b100189f49

View File

@@ -10207,6 +10207,7 @@ profile_manager_cgdcont_query_ready (MMBaseModem *self,
ctx = g_slice_new0 (ListProfilesContext);
g_task_set_task_data (task, ctx, (GDestroyNotify) list_profiles_context_free);
ctx->profiles = mm_3gpp_profile_list_new_from_pdp_context_list (pdp_context_list);
mm_3gpp_pdp_context_list_free (pdp_context_list);
g_task_return_boolean (task, TRUE);
g_object_unref (task);