[sr-dev] git:5.2:bdced086: core: proper check for allocation of route_locks_size

Daniel-Constantin Mierla miconda at gmail.com
Mon May 13 10:06:07 CEST 2019


Module: kamailio
Branch: 5.2
Commit: bdced08654188d70da6af776ac73c851196425b4
URL: https://github.com/kamailio/kamailio/commit/bdced08654188d70da6af776ac73c851196425b4

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-05-13T10:05:17+02:00

core: proper check for allocation of route_locks_size

- regression added with relocation of code

(cherry picked from commit 403de77c079a125ac101ff2ae58e08551a12a022)

---

Modified: src/core/receive.c

---

Diff:  https://github.com/kamailio/kamailio/commit/bdced08654188d70da6af776ac73c851196425b4.diff
Patch: https://github.com/kamailio/kamailio/commit/bdced08654188d70da6af776ac73c851196425b4.patch

---

diff --git a/src/core/receive.c b/src/core/receive.c
index d7e3effdd6..1dbe07ad96 100644
--- a/src/core/receive.c
+++ b/src/core/receive.c
@@ -49,6 +49,7 @@
 #include "xavp.h"
 #endif
 #include "select_buf.h"
+#include "locking.h"
 
 #include "tcp_server.h"  /* for tcpconn_add_alias */
 #include "tcp_options.h" /* for access to tcp_accept_aliases*/
@@ -78,7 +79,7 @@ int ksr_route_locks_set_init(void)
 		return 0;
 
 	ksr_route_locks_set = rec_lock_set_alloc(ksr_route_locks_size);
-	if(ksr_route_locks_set) {
+	if(ksr_route_locks_set==NULL) {
 		LM_ERR("failed to allocate route locks set\n");
 		return -1;
 	}




More information about the sr-dev mailing list