Browse Source

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 7 years ago
parent
commit
f42e5420f5
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/modules/ims_charging/ro_session_hash.h

+ 7 - 0
src/modules/ims_charging/ro_session_hash.h

@@ -158,6 +158,13 @@ extern struct ro_session_table *ro_session_table;
  * \param ro_session unlinked ro_session
  */
 static inline void unlink_unsafe_ro_session(struct ro_session_entry *ro_session_entry, struct ro_session *ro_session) {
+	if ((ro_session->next == 0x00) &&
+			(ro_session->prev == 0x00) &&
+			(ro_session != ro_session_entry->first) )
+	{
+		return;
+	}
+
     if (ro_session->next)
         ro_session->next->prev = ro_session->prev;
     else