summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjnath/src/pjnath/ice_session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index 841c74b0..d725b9b0 100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -2313,12 +2313,14 @@ static void on_stun_request_complete(pj_stun_session *stun_sess,
ice->valid_list.checks[i].nominated = check->nominated;
}
- /* Sort valid_list */
- sort_checklist(&ice->valid_list);
-
/* Update valid check and nominated check for the component */
update_comp_check(ice, new_check->lcand->comp_id, new_check);
+ /* Sort valid_list (must do so after update_comp_check(), otherwise
+ * new_check will point to something else (#953)
+ */
+ sort_checklist(&ice->valid_list);
+
/* 7.1.2.2.2. Updating Pair States
*
* The agent sets the state of the pair that generated the check to