[sr-dev] [kamailio/kamailio] Keepalive - Remove race condition when removing destination (#2474)

Victor Seva notifications at github.com
Thu Sep 10 16:19:48 CEST 2020


@linuxmaniac requested changes on this pull request.



> +	lock_get(target->lock);
+	free_destination(target); // Lock is released and freed in this free function
 	if(!head){
 		LM_DBG("There isn't any head so maybe it is first \r\n");
 		ka_destinations_list->first = target->next;
-		free_destination(target);
-		ka_unlock_destination_list();
-		return 1;
+	} else {
+		head->next = target->next;
 	}
-	head->next = target->next;
-	free_destination(target);
 	ka_unlock_destination_list();

You can't call free_destination(target) and after that use target

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2474#pullrequestreview-485984991
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200910/2331eb58/attachment-0001.htm>


More information about the sr-dev mailing list