소스 검색

ims_usrloc_scscf: Fix ref-counting from previous commit...

Carsten Bock 10 년 전
부모
커밋
d37f534564
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      modules/ims_usrloc_scscf/impurecord.c

+ 7 - 1
modules/ims_usrloc_scscf/impurecord.c

@@ -846,8 +846,14 @@ int update_impurecord(struct udomain* _d, str* public_identity, impurecord_t* im
             unlock_subscription_slot(subs_ptr->sl);
         } else {
             //TODO: we may want to do a deep comparison of the subscription and update....
-            if (compare_subscription(subs_ptr, subscription) != 0)
+            if (compare_subscription(subs_ptr, subscription) != 0) {
                 subs_ptr = subscription;
+            } else {
+                // Treat it as a new Subscription - it's not the same as the previos one
+                ref_subscription_unsafe(subs_ptr); //we reference coz we are using it - will be unreferenced later.
+                add_subscription_unsafe(subs_ptr);
+                unlock_subscription_slot(subs_ptr->sl);
+            }            
         }
         lock_subscription(subs_ptr);
         subscription_locked = 1;