]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clean up a clangalyzer warning in directory_remove_invalid
authorNick Mathewson <nickm@torproject.org>
Mon, 15 Sep 2014 17:52:56 +0000 (13:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 15 Sep 2014 17:52:56 +0000 (13:52 -0400)
"At this point in the code, msg has been set to a string
constant. But the tor code checks that msg is not NULL, and the
redundant NULL check confuses the analyser[...] To avoid this
spurious warning, the patch initialises msg to NULL."

Patch from teor. another part of 13157.

src/or/dirserv.c

index a5ad742b96143ed066dbd1cd1c3fc2fb6f19e5dc..91314405df4ef6d028582a67c6f6fe83af7eb1c7 100644 (file)
@@ -664,7 +664,7 @@ directory_remove_invalid(void)
   smartlist_add_all(nodes, nodelist_get_list());
 
   SMARTLIST_FOREACH_BEGIN(nodes, node_t *, node) {
-    const char *msg;
+    const char *msg = NULL;
     routerinfo_t *ent = node->ri;
     char description[NODE_DESC_BUF_LEN];
     uint32_t r;