OSDN Git Service

Fix double-free
authorJohan Hedberg <johan.hedberg@nokia.com>
Tue, 7 Jul 2009 07:50:38 +0000 (10:50 +0300)
committerJohan Hedberg <johan.hedberg@nokia.com>
Tue, 7 Jul 2009 07:50:38 +0000 (10:50 +0300)
The adapter->oor_devices list doesn't actually own the data that the
elements point to so free() should never be called on them.

src/adapter.c

index 8dd5faf..3fd0a9b 100644 (file)
@@ -2142,7 +2142,6 @@ int adapter_stop(struct btd_adapter *adapter)
        clear_found_devices_list(adapter);
 
        if (adapter->oor_devices) {
-               g_slist_foreach(adapter->oor_devices, (GFunc) free, NULL);
                g_slist_free(adapter->oor_devices);
                adapter->oor_devices = NULL;
        }