sim: Do not leak aid_list

==31530== 366 (48 direct, 318 indirect) bytes in 3 blocks are definitely lost in loss record 165 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x50BB3A3: g_malloc (gmem.c:94)
==31530==    by 0x50D62B4: g_slice_alloc (gslice.c:1025)
==31530==    by 0x50D7A1E: g_slist_prepend (gslist.c:254)
==31530==    by 0x4DD0B3: sim_parse_app_template_entries (simutil.c:1590)
==31530==    by 0x4D2242: discover_apps_cb (sim.c:1509)
==31530==    by 0x45E364: at_discover_apps_cb (sim.c:1579)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
==31530==    by 0x49FCEF: received_data (gatio.c:122)
==31530==    by 0x510C2F3: g_io_unix_dispatch (giounix.c:165)
==31530==    by 0x50B2D44: g_main_dispatch (gmain.c:3203)
This commit is contained in:
Denis Kenzior 2018-02-28 11:22:46 -06:00
parent dc59351de6
commit d65a2fc377
1 changed files with 6 additions and 0 deletions

View File

@ -2601,6 +2601,12 @@ static void sim_free_main_state(struct ofono_sim *sim)
if (sim->impi)
g_free(sim->impi);
if (sim->aid_list) {
g_slist_free_full(sim->aid_list,
(GDestroyNotify) sim_app_record_free);
sim->aid_list = NULL;
}
if (sim->aid_sessions) {
g_slist_free_full(sim->aid_sessions, aid_session_free);
sim->aid_sessions = NULL;