From a9152f21ff40f4515237c40c691e2b87511b0c41 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 6 Oct 2010 23:09:06 -0500 Subject: [PATCH] huawei: fix potential double-free on error (rh #632516) --- plugins/mm-plugin-huawei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mm-plugin-huawei.c b/plugins/mm-plugin-huawei.c index 2993689d..eb141bfd 100644 --- a/plugins/mm-plugin-huawei.c +++ b/plugins/mm-plugin-huawei.c @@ -239,9 +239,6 @@ supports_port (MMPluginBase *base, info->id = g_timeout_add_seconds (7, probe_secondary_timeout, task); - g_object_set_data_full (G_OBJECT (task), TAG_SUPPORTS_INFO, - info, huawei_supports_info_destroy); - if (!mm_serial_port_open (MM_SERIAL_PORT (info->serial), &error)) { g_warning ("%s: (Huawei) %s: couldn't open serial port: (%d) %s", __func__, name, @@ -252,6 +249,9 @@ supports_port (MMPluginBase *base, return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED; } + g_object_set_data_full (G_OBJECT (task), TAG_SUPPORTS_INFO, + info, huawei_supports_info_destroy); + return MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS; }