base-manager: plug memleak
Don't g_strdup() the physdev string to store it in the hash table; instead store the original string right away as it is already created with g_strdup_printf(). Reported by: Yunlian Jiang <yunlian@chromium.org> https://code.google.com/p/chromium/issues/detail?id=515929
This commit is contained in:
@@ -749,9 +749,7 @@ handle_set_profile (MmGdbusTest *skeleton,
|
||||
/* Create device and keep it listed in the Manager */
|
||||
physdev = g_strdup_printf ("/virtual/%s", id);
|
||||
device = mm_device_virtual_new (physdev, TRUE);
|
||||
g_hash_table_insert (self->priv->devices,
|
||||
g_strdup (physdev),
|
||||
device);
|
||||
g_hash_table_insert (self->priv->devices, physdev, device);
|
||||
|
||||
/* Grab virtual ports */
|
||||
mm_device_virtual_grab_ports (device, (const gchar **)ports);
|
||||
|
Reference in New Issue
Block a user