[sr-dev] git:master:78225d06: htable: use local variable for name in log message instead of null htable pointer

Daniel-Constantin Mierla miconda at gmail.com
Mon Nov 19 09:12:00 CET 2018


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-11-19T09:10:46+01:00

htable: use local variable for name in log message instead of null htable pointer

---

Modified: src/modules/htable/ht_dmq.c

---

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

---

diff --git a/src/modules/htable/ht_dmq.c b/src/modules/htable/ht_dmq.c
index 33dd72e8d4..d5ff1af645 100644
--- a/src/modules/htable/ht_dmq.c
+++ b/src/modules/htable/ht_dmq.c
@@ -576,11 +576,15 @@ int ht_dmq_handle_sync(srjson_doc_t* jdoc) {
 		}
 
 		ht = ht_get_table(&htname);
-		if(ht==NULL)
-			LM_WARN("unable to get table %.*s\n", ht->name.len, ht->name.s);
+		if(ht==NULL) {
+			LM_WARN("unable to get table %.*s\n",
+					htname.len, (htname.s)?htname.s:"");
+		}
 
-		if (ht_set_cell_ex(ht, &cname, type, &val, 0, expire - now) < 0)
-			LM_WARN("unable to set cell %.*s in table %.*s\n", cname.len, cname.s, ht->name.len, ht->name.s);
+		if (ht_set_cell_ex(ht, &cname, type, &val, 0, expire - now) < 0) {
+			LM_WARN("unable to set cell %.*s in table %.*s\n",
+					cname.len, cname.s, ht->name.len, ht->name.s);
+		}
 
 		cell = cell->next;
 	}




More information about the sr-dev mailing list