network: Don't free known networks in network_info_put

Fix a double free resulting from network.c freeing a known network when
it goes out of range due to a missing check.
This commit is contained in:
Andrew Zaborowski 2018-07-30 14:50:35 +02:00 committed by Denis Kenzior
parent 2cd8480feb
commit 215162a49e
1 changed files with 2 additions and 2 deletions

View File

@ -292,8 +292,8 @@ static void network_info_put(struct network_info *network)
if (!networks)
return;
l_queue_remove(networks, network);
network_info_free(network);
if (l_queue_remove(networks, network))
network_info_free(network);
}
struct network *network_create(struct device *device, const char *ssid,