Browse Source

[802.11] Fix memory leak on unsuccessful probes

When a probe found no results, the list head of beacons would not be
freed, leaking 16 bytes of memory per probe.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v0.9.8
Joshua Oreman 14 years ago
parent
commit
fc9750a68d
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/net/80211/net80211.c

+ 1
- 2
src/net/80211/net80211.c View File

@@ -1521,8 +1521,7 @@ net80211_probe_finish_best ( struct net80211_probe_ctx *ctx )
1521 1521
 		DBGC ( ctx->dev, "802.11 %p probe: found nothing for '%s'\n",
1522 1522
 		       ctx->dev, ctx->essid );
1523 1523
 
1524
-	if ( ! list_empty ( ctx->beacons ) )
1525
-		net80211_free_wlanlist ( ctx->beacons );
1524
+	net80211_free_wlanlist ( ctx->beacons );
1526 1525
 
1527 1526
 	net80211_keep_mgmt ( ctx->dev, ctx->old_keep_mgmt );
1528 1527
 

Loading…
Cancel
Save