summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-15 14:38:37 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-15 15:46:45 +0100
commit1a5c521daee8842ffc2d684fd326679c435779f7 (patch)
tree7e608a6332ce2d1ca2b1452b232fe406cd64ed9b
parent4ca7aa55b88ba2bdfc77259140e229a739a668e1 (diff)
libqmi-glib,endpoint-qmux: plug QmiClientCtl leak
This is a severe leak when using qmicli operations, as e.g. in OpenWRT based setups. It's shown as still reachable here, because it's really not a true leak as in we can no longer free it; there's some pointer to the objects around but we never free them, so the memory grows and keeps growing all the time. ==6589== 506,784 bytes in 10,558 blocks are still reachable in loss record 1,378 of 1,378 ==6589== at 0x4E84925: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.6600.7) ==6589== by 0x4E7501D: ??? (in /usr/lib/libgobject-2.0.so.0.6600.7) ==6589== by 0x4E768C3: g_object_new_valist (in /usr/lib/libgobject-2.0.so.0.6600.7) ==6589== by 0x4E76C39: g_object_new (in /usr/lib/libgobject-2.0.so.0.6600.7) ==6589== by 0x4911E39: client_ctl_setup (qmi-device.c:3009) ==6589== by 0x4911FA2: check_type_async_ready (qmi-device.c:3047) ==6589== by 0x4D39173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7) ==6589== by 0x4D3D6E8: ??? (in /usr/lib/libgio-2.0.so.0.6600.7) ==6589== by 0x4916FEB: query_info_async_ready (qmi-file.c:105) ==6589== by 0x4D39173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7) ==6589== by 0x4D391A8: ??? (in /usr/lib/libgio-2.0.so.0.6600.7) ==6589== by 0x4F01B83: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6600.7) ==6589== ==6589== LEAK SUMMARY: ==6589== definitely lost: 0 bytes in 0 blocks ==6589== indirectly lost: 0 bytes in 0 blocks ==6589== possibly lost: 2,424 bytes in 25 blocks ==6589== still reachable: 1,702,273 bytes in 33,071 blocks ==6589== of which reachable via heuristic: ==6589== length64 : 1,384 bytes in 28 blocks ==6589== newarray : 1,776 bytes in 31 blocks ==6589== suppressed: 0 bytes in 0 blocks Fixes https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/39 (cherry picked from commit 36a990794307e47806a6be2f97e3eabde220640b)
-rw-r--r--src/libqmi-glib/qmi-endpoint-qmux.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libqmi-glib/qmi-endpoint-qmux.c b/src/libqmi-glib/qmi-endpoint-qmux.c
index 5709f85..5cc21f6 100644
--- a/src/libqmi-glib/qmi-endpoint-qmux.c
+++ b/src/libqmi-glib/qmi-endpoint-qmux.c
@@ -504,6 +504,7 @@ dispose (GObject *object)
QmiEndpointQmux *self = QMI_ENDPOINT_QMUX (object);
destroy_iostream (self);
+ g_clear_object (&self->priv->client_ctl);
G_OBJECT_CLASS (qmi_endpoint_qmux_parent_class)->dispose (object);
}