From: Guus Sliepen Date: Mon, 16 Nov 2015 13:33:39 +0000 (+0100) Subject: Fix warnings from the Clang Static Analyzer. X-Git-Tag: release-1.0.27~22 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=dc6c113176697aafb013feda87af973d80349585;p=tinc Fix warnings from the Clang Static Analyzer. These were all harmless. --- diff --git a/src/avl_tree.c b/src/avl_tree.c index 6b855165..f1645d52 100644 --- a/src/avl_tree.c +++ b/src/avl_tree.c @@ -123,8 +123,6 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) avl_node_t *parent; avl_node_t **superparent; - parent = node; - while(node) { parent = node->parent; diff --git a/src/net_packet.c b/src/net_packet.c index e67857cc..5ab08e24 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -276,7 +276,7 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) { vpn_packet_t pkt1, pkt2; vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 }; int nextpkt = 0; - vpn_packet_t *outpkt = pkt[0]; + vpn_packet_t *outpkt; int outlen, outpad; unsigned char hmac[EVP_MAX_MD_SIZE]; int i; diff --git a/src/tincd.c b/src/tincd.c index a2b35805..ed0cee93 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -239,7 +239,8 @@ static bool parse_options(int argc, char **argv) { usage(true); return false; } - netname = strcmp(optarg, ".") != 0 ? xstrdup(optarg) : NULL; + if(optarg && strcmp(optarg, ".")) + netname = xstrdup(optarg); break; case 'o': /* option */