From dc6c113176697aafb013feda87af973d80349585 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 16 Nov 2015 14:33:39 +0100 Subject: [PATCH] Fix warnings from the Clang Static Analyzer. These were all harmless. --- src/avl_tree.c | 2 -- src/net_packet.c | 2 +- src/tincd.c | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) 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 */ -- 2.20.1