From 0cfc825e11ba935d84c51e2d206d3e7ee242b9fb Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 26 Jan 2014 10:55:43 +0100 Subject: huawei: fix leaked 'GUdevDevice' --- plugins/huawei/mm-broadband-modem-huawei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 695b9274..7063b8f7 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -2126,13 +2126,15 @@ huawei_modem_create_bearer (MMIfaceModem *self, client, "net", mm_port_get_device (port))); - if (g_udev_device_get_property_as_boolean (net_port, "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { + if (net_port && g_udev_device_get_property_as_boolean (net_port, "ID_MM_HUAWEI_NDISDUP_SUPPORTED")) { mm_dbg ("This device (%s) can support ndisdup feature", mm_port_get_device (port)); ctx->self->priv->ndisdup_support = FEATURE_SUPPORTED; } else { mm_dbg ("This device (%s) can not support ndisdup feature", mm_port_get_device (port)); ctx->self->priv->ndisdup_support = FEATURE_NOT_SUPPORTED; } + if (net_port) + g_object_unref (net_port); g_object_unref (client); } -- cgit v1.2.3-70-g09d2