[sr-dev] git:master:211915ae: core: sr module - check for null to avoid free warning

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 15 10:40:46 CET 2021


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-02-15T10:39:56+01:00

core: sr module - check for null to avoid free warning

---

Modified: src/core/sr_module.c

---

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

---

diff --git a/src/core/sr_module.c b/src/core/sr_module.c
index 0a7ba37848..c37e1ab680 100644
--- a/src/core/sr_module.c
+++ b/src/core/sr_module.c
@@ -509,7 +509,7 @@ int ksr_locate_module(char *mod_path, char **new_path)
 	return 0;
 
 error:
-	if(path!=mod_path) {
+	if(path!=NULL && path!=mod_path) {
 		pkg_free(path);
 	}
 




More information about the sr-dev mailing list