Browse code

ims_charging: check if the session to be linked is actually part of list

- issue reported and patch suggested by GH #1549

Daniel-Constantin Mierla authored on 20/06/2018 06:30:20
Showing 1 changed files
... ...
@@ -158,6 +158,13 @@ extern struct ro_session_table *ro_session_table;
158 158
  * \param ro_session unlinked ro_session
159 159
  */
160 160
 static inline void unlink_unsafe_ro_session(struct ro_session_entry *ro_session_entry, struct ro_session *ro_session) {
161
+	if ((ro_session->next == 0x00) &&
162
+			(ro_session->prev == 0x00) &&
163
+			(ro_session != ro_session_entry->first) )
164
+	{
165
+		return;
166
+	}
167
+
161 168
     if (ro_session->next)
162 169
         ro_session->next->prev = ro_session->prev;
163 170
     else