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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-04-10T19:17:04+02:00

core: print path in debug before releasing when load module option skips 
duplicates

---

Modified: src/core/sr_module.c

---

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

---

diff --git a/src/core/sr_module.c b/src/core/sr_module.c
index a2e28acf030..d6d1d117188 100644
--- a/src/core/sr_module.c
+++ b/src/core/sr_module.c
@@ -617,10 +617,12 @@ int ksr_load_module(char *mod_path, char *opts)
        for(t = modules; t; t = t->next) {
                if(t->handle == handle) {
                        if(ldopt == 1) {
-                               if(path && path != mod_path) {
-                                       pkg_free(path);
+                               if(path) {
+                                       LM_DBG("skip loading optional module 
twice (%s)\n", path);
+                                       if(path != mod_path) {
+                                               pkg_free(path);
+                                       }
                                }
-                               LM_DBG("skip loading optional module twice 
(%s)\n", path);
                                return 0;
                        }
                        LM_WARN("attempting to load the same module twice 
(%s)\n", path);

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to