httpinfo: fix a Coverity warning
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Feb 2015 20:20:10 +0000 (21:20 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Feb 2015 20:47:56 +0000 (21:47 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/httpinfo/src/olsrd_httpinfo.c

index 5d609f2..f1a5bab 100644 (file)
@@ -1590,7 +1590,7 @@ static void sgw_ipvx(struct autobuf *abuf, bool ipv6) {
           abuf_appendf(abuf, "      <td>%u</td>\n", gw->gw->uplink);
           abuf_appendf(abuf, "      <td>%u</td>\n", gw->gw->downlink);
 
-          if (tc->path_cost == ROUTE_COST_BROKEN) {
+          if (!tc || tc->path_cost == ROUTE_COST_BROKEN) {
             abuf_appendf(abuf, "      <td>Unreachable</td>\n");
           } else {
             abuf_appendf(abuf, "      <td>%u</td>\n", etx);