diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-23 22:45:42 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-23 22:45:42 +0200 |
commit | 0b1906618eb47b8bd37fba61507259ef09584031 (patch) | |
tree | 9918adb95207480b69bac327b1e6c886db8e4d1e /src | |
parent | 48f41aa97623c5ca0873f107267adb0902039ec8 (diff) |
libqmi-glib,device: plug leak when allocating new links
==44890== 64 bytes in 4 blocks are definitely lost in loss record 4,011 of 5,965
==44890== at 0x4840B65: calloc (vg_replace_malloc.c:760)
==44890== by 0x508AA61: g_malloc0 (in /usr/lib/libglib-2.0.so.0.6800.1)
==44890== by 0x4A3B21A: device_add_link_ready (qmi-device.c:1857)
==44890== by 0x4EB73D3: ??? (in /usr/lib/libgio-2.0.so.0.6800.1)
==44890== by 0x4EB7408: ??? (in /usr/lib/libgio-2.0.so.0.6800.1)
==44890== by 0x5081F2F: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6800.1)
==44890== by 0x50D5B58: ??? (in /usr/lib/libglib-2.0.so.0.6800.1)
==44890== by 0x5081592: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.6800.1)
==44890== by 0x15A503: main (main.c:213)
Diffstat (limited to 'src')
-rw-r--r-- | src/libqmi-glib/qmi-device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index d84eadd..3c41506 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -1825,6 +1825,7 @@ qmi_device_add_link_with_flags_finish (QmiDevice *self, GError **error) { AddLinkResult *ctx; + gchar *ifname; ctx = g_task_propagate_pointer (G_TASK (res), error); if (!ctx) @@ -1833,7 +1834,9 @@ qmi_device_add_link_with_flags_finish (QmiDevice *self, if (mux_id) *mux_id = ctx->mux_id; - return g_steal_pointer (&ctx->ifname); + ifname = g_steal_pointer (&ctx->ifname); + add_link_result_free (ctx); + return ifname; } gchar * |