route: Preventing small bug with accessing of unallocated memory

Change-Id: I79c2099b2400aca78bbdb6d7de2f68d3f659e2b6
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 6159563..7a8572d 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -66,6 +66,7 @@
                                                  ndn::bind(&nexthopCompare, _1, nh));
   if (it == m_nexthopList.end()) {
     m_nexthopList.push_back(nh);
+    return;
   }
   if ((*it).getRouteCost() > nh.getRouteCost()) {
     (*it).setRouteCost(nh.getRouteCost());