From 215162a49e6735cfffb8214f10ab835a6cc57918 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Mon, 30 Jul 2018 14:50:35 +0200 Subject: [PATCH] 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. --- src/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network.c b/src/network.c index 203579c1..165e930f 100644 --- 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,