Module: kamailio
Branch: master
Commit: 181c602616e13323786335e8e28f182871aa5e9b
URL: 
https://github.com/kamailio/kamailio/commit/181c602616e13323786335e8e28f182871aa5e9b

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-03-01T09:37:59+01:00

core: rthreads - init return variable

---

Modified: src/core/rthreads.h

---

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

---

diff --git a/src/core/rthreads.h b/src/core/rthreads.h
index 0f4f0cf8b8a..1a04f9982c7 100644
--- a/src/core/rthreads.h
+++ b/src/core/rthreads.h
@@ -38,7 +38,7 @@ static void *run_threadP(_thread_proto fn, void *arg)
 {
 #ifdef USE_TLS
        pthread_t tid;
-       void *ret;
+       void *ret = NULL;
 
        if(likely(ksr_tls_threads_mode == 0
                           || (ksr_tls_threads_mode == 1 && process_no > 0))) {
@@ -75,7 +75,7 @@ static void *run_threadPI(_thread_protoPI fn, void *arg1, int 
arg2)
 {
 #ifdef USE_TLS
        pthread_t tid;
-       void *ret;
+       void *ret = NULL;
 
        if(likely(ksr_tls_threads_mode == 0
                           || (ksr_tls_threads_mode == 1 && process_no > 0))) {
@@ -150,7 +150,7 @@ static int run_thread4PP(_thread_proto4PP fn, void *arg1, 
void *arg2)
 {
 #ifdef USE_TLS
        pthread_t tid;
-       int ret;
+       int ret = 0;
 
        if(likely(ksr_tls_threads_mode == 0
                           || (ksr_tls_threads_mode == 1 && process_no > 0))) {
@@ -238,7 +238,7 @@ static int run_thread4P5I2P2(_thread_proto4P5I2P2 fn, void 
*arg1, void *arg2,
 {
 #ifdef USE_TLS
        pthread_t tid;
-       int ret;
+       int ret = 0;
 
        if(likely(ksr_tls_threads_mode == 0
                           || (ksr_tls_threads_mode == 1 && process_no > 0))) {
@@ -276,7 +276,7 @@ static int run_thread4L(_thread_proto4L fn, long arg1)
 {
 #ifdef USE_TLS
        pthread_t tid;
-       int ret;
+       int ret = 0;
 
        if(likely(ksr_tls_threads_mode == 0
                           || (ksr_tls_threads_mode == 1 && process_no > 0))) {

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to