session: free memory for datafeed callbacks, reported by valgrind

==17549== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 39
==17549==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17549==    by 0x5359200: g_malloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x536EE2D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x5370165: g_slist_append (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x4E595C3: sr_session_datafeed_callback_add (session.c:512)
==17549==    by 0x409527: load_input_file_module (input.c:111)
==17549==    by 0x4097AB: load_input_file (input.c:157)
==17549==    by 0x40531E: main (main.c:288)
This commit is contained in:
Stefan Brüns 2015-11-26 03:04:39 +01:00 committed by Uwe Hermann
parent fe7b8efc6b
commit 877a6d09d5
1 changed files with 2 additions and 0 deletions

View File

@ -256,6 +256,8 @@ SR_API int sr_session_destroy(struct sr_session *session)
sr_session_dev_remove_all(session);
g_slist_free_full(session->owned_devs, (GDestroyNotify)sr_dev_inst_free);
sr_session_datafeed_callback_remove_all(session);
g_hash_table_unref(session->event_sources);
g_mutex_clear(&session->main_mutex);