diff options
author | Denis Kenzior <denkenz@gmail.com> | 2018-02-28 11:22:46 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-02-28 11:22:46 -0600 |
commit | d65a2fc3773957697e8040001ac647aaad08d7d3 (patch) | |
tree | a8430a5cc5d46d419adf5999bb101fd9f406fd0a /src/sim.c | |
parent | dc59351de61f5b61a8e687448586349f3f4b780a (diff) | |
download | ofono-d65a2fc3773957697e8040001ac647aaad08d7d3.tar.gz |
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)
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |