diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-24 21:47:59 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-25 00:46:12 +0100 |
commit | aa3e9ebcb409e97ab3e61f17df7c154b8455d568 (patch) | |
tree | de6e6f5e951a610260b6f37f84dcf43114328913 | |
parent | f33d16404d6cd78bfe33d445d1786f731a036440 (diff) |
segfault: context_map gc: use llist_for_each_entry_safe()
The context map garbage collector removes entries from the list, hence it must
use llist_for_each_entry_safe().
We haven't hit this before since nothing is yet flagging context maps to be
discarded.
Related: OS#2776
Change-Id: I9d5899923054d1bf862d542fec862fb1e6f07dce
-rw-r--r-- | src/context_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/context_map.c b/src/context_map.c index 0c891cf..dca276a 100644 --- a/src/context_map.c +++ b/src/context_map.c @@ -146,10 +146,10 @@ static void context_map_tmr_cb(void *data) { struct hnb_gw *gw = data; struct hnbgw_cnlink *cn = gw->sccp.cnlink; - struct hnbgw_context_map *map; + struct hnbgw_context_map *map, *next_map; DEBUGP(DMAIN, "Running context mapper garbage collection\n"); - llist_for_each_entry(map, &cn->map_list, cn_list) { + llist_for_each_entry_safe(map, next_map, &cn->map_list, cn_list) { switch (map->state) { case MAP_S_RESERVED1: /* first time we see this reserved |