commit 215162a49e6735cfffb8214f10ab835a6cc57918
parent 2cd8480feb20418a1fd541d74b7f327879b35536
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Mon, 30 Jul 2018 14:50:35 +0200
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.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/network.c b/src/network.c
@@ -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,