From ab6faaeeb40bc63a175c91645d9920cbcb53547b Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 19 Jul 2021 20:04:16 +0530 Subject: gstptpclock: Don't leak the GList 120 bytes in 5 blocks are definitely lost in loss record 7,615 of 9,510 at 0x484486F: malloc (vg_replace_malloc.c:380) by 0x58A2938: g_malloc (gmem.c:106) by 0x58BA1F4: g_slice_alloc (gslice.c:1069) by 0x588F059: g_list_prepend (glist.c:335) by 0x5B9C5C0: select_best_master_clock (gstptpclock.c:756) by 0x5B9CA8E: cleanup_cb (gstptpclock.c:1930) by 0x589AD20: g_timeout_dispatch (gmain.c:4889) by 0x589A4CE: UnknownInlinedFun (gmain.c:3337) by 0x589A4CE: g_main_context_dispatch (gmain.c:4055) by 0x58EE4E7: g_main_context_iterate.constprop.0 (gmain.c:4131) by 0x5899A92: g_main_loop_run (gmain.c:4329) by 0x5B9BA4C: ptp_helper_main (gstptpclock.c:1980) by 0x58C8C31: g_thread_proxy (gthread.c:826) 576 bytes in 24 blocks are definitely lost in loss record 8,782 of 9,510 at 0x484486F: malloc (vg_replace_malloc.c:380) by 0x58A2938: g_malloc (gmem.c:106) by 0x58BA1F4: g_slice_alloc (gslice.c:1069) by 0x588F059: g_list_prepend (glist.c:335) by 0x5B9C5C0: select_best_master_clock (gstptpclock.c:756) by 0x5B9EFA0: handle_announce_message (gstptpclock.c:934) by 0x5B9EFA0: handle_ptp_message (gstptpclock.c:1765) by 0x5B9EFA0: have_stdin_data_cb (gstptpclock.c:1851) by 0x589A4CE: UnknownInlinedFun (gmain.c:3337) by 0x589A4CE: g_main_context_dispatch (gmain.c:4055) by 0x58EE4E7: g_main_context_iterate.constprop.0 (gmain.c:4131) by 0x5899A92: g_main_loop_run (gmain.c:4329) by 0x5B9BA4C: ptp_helper_main (gstptpclock.c:1980) by 0x58C8C31: g_thread_proxy (gthread.c:826) by 0x5DA4298: start_thread (pthread_create.c:481) Part-of: --- libs/gst/net/gstptpclock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gst/net/gstptpclock.c b/libs/gst/net/gstptpclock.c index c2d09152c2..19b90e5969 100644 --- a/libs/gst/net/gstptpclock.c +++ b/libs/gst/net/gstptpclock.c @@ -772,6 +772,7 @@ select_best_master_clock (PtpDomainData * domain, GstClockTime now) if (!best || compare_announce_message (msg, best) < 0) best = msg; } + g_clear_pointer (&qualified_messages, g_list_free); if (domain->have_master_clock && compare_clock_identity (&domain->master_clock_identity, -- cgit v1.2.3