[sr-dev] git:master:a9cce177: modules/sipcapture: fix possible NULL pointer dereference

Mikko Lehto mslehto at iki.fi
Wed May 25 21:33:36 CEST 2016


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

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Mikko Lehto <mslehto at iki.fi>
Date: 2016-05-24T13:23:10+03:00

modules/sipcapture: fix possible NULL pointer dereference

---

Modified: modules/sipcapture/sipcapture.c

---

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

---

diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c
index 8a3fb7b..83eae4d 100644
--- a/modules/sipcapture/sipcapture.c
+++ b/modules/sipcapture/sipcapture.c
@@ -626,13 +626,13 @@ void * capture_mode_init(str *name, str * params) {
 	return n;
 
 error:
-	if (n->name.s){
-		pkg_free(n->name.s);
-	}
-	if (n->table_names){
-		pkg_free(n->table_names);
-	}
 	if (n){
+		if (n->name.s){
+			pkg_free(n->name.s);
+		}
+		if (n->table_names){
+			pkg_free(n->table_names);
+		}
 		pkg_free(n);
 	}
 	return 0;




More information about the sr-dev mailing list