huawei: fix potential double-free on error (rh #632516)

This commit is contained in:
Dan Williams
2010-10-06 23:09:06 -05:00
parent acc4541ab3
commit a9152f21ff

View File

@@ -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;
}