Browse Source

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

Daniel-Constantin Mierla 6 years ago
parent
commit
78225d064a
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/modules/htable/ht_dmq.c

+ 8 - 4
src/modules/htable/ht_dmq.c

@@ -576,11 +576,15 @@ int ht_dmq_handle_sync(srjson_doc_t* jdoc) {
 		}
 		}
 
 
 		ht = ht_get_table(&htname);
 		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;
 		cell = cell->next;
 	}
 	}