[PATCH 0/1] libmm-glib: fix leaking MMModemPortInfo and bearer_path string

Piotr Figiel figiel at gmail.com
Wed Feb 8 15:09:12 UTC 2017


From: Piotr Figiel <p.figiel at camlintechnologies.com>

There are two leaks reported by valgrind on NetworkManager using ModemManager's
libmm-glib, this is reproducible upon modem restart with NetworkManager version
1.4.  This patch was tested on top of mm-1-6, but it's also aplicable on
master.  Please review and merge if applicable.

Valgrind output:

==261== 482 bytes in 12 blocks are definitely lost in loss record 7,290 of 7,383
==261== at 0x402C51E: malloc (vg_replace_malloc.c:299)
==261== by 0x4484878: g_malloc (gmem.c:94)
==261== by 0x449D51D: g_strdup (gstrfuncs.c:363)
==261== by 0x44B5B73: g_variant_dup_string (gvariant.c:1529)
==261== by 0x44B945E: g_variant_valist_get_nnp (gvariant.c:4775)
==261== by 0x44B945E: g_variant_valist_get_leaf (gvariant.c:4945)
==261== by 0x44B945E: g_variant_valist_get (gvariant.c:5126)
==261== by 0x44B922C: g_variant_valist_get (gvariant.c:5161)
==261== by 0x44B9FC9: g_variant_get_va (gvariant.c:5388)
==261== by 0x44BA1DB: g_variant_get (gvariant.c:5335)
==261== by 0x664E2EF: mm_gdbus_modem_simple_call_connect_finish (mm-gdbus-modem.c:22451)
==261== by 0x6608A08: simple_connect_ready (mm-modem-simple.c:154)
==261== by 0x429136F: g_task_return_now (gtask.c:1107)
==261== by 0x4291A69: g_task_return (gtask.c:1165)
==261==
==261== 672 bytes in 84 blocks are definitely lost in loss record 7,314 of 7,383
==261== at 0x402C51E: malloc (vg_replace_malloc.c:299)
==261== by 0x4484878: g_malloc (gmem.c:94)
==261== by 0x449D51D: g_strdup (gstrfuncs.c:363)
==261== by 0x44B5B73: g_variant_dup_string (gvariant.c:1529)
==261== by 0x44B945E: g_variant_valist_get_nnp (gvariant.c:4775)
==261== by 0x44B945E: g_variant_valist_get_leaf (gvariant.c:4945)
==261== by 0x44B945E: g_variant_valist_get (gvariant.c:5126)
==261== by 0x44B922C: g_variant_valist_get (gvariant.c:5161)
==261== by 0x44B9FC9: g_variant_get_va (gvariant.c:5388)
==261== by 0x44BA3C5: g_variant_get_child (gvariant.c:5486)
==261== by 0x6613FA8: mm_common_ports_variant_to_garray (mm-common-helpers.c:238)
==261== by 0x6601AB9: ensure_internal_ports (mm-modem.c:766)
==261== by 0x6603E42: mm_modem_peek_ports (mm-modem.c:825)
==261== by 0x65CD94D: owns_port (nm-modem-broadband.c:196)

Piotr Figiel (1):
  libmm-glib: fix leaking MMModemPortInfo and bearer_path string

 libmm-glib/mm-modem-simple.c | 1 +
 libmm-glib/mm-modem.c        | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
1.9.1



More information about the ModemManager-devel mailing list