Resolve ASan errors that will be thrown once it is turned on

Plus few minor spelling and code-style issues

refs: #4230

Change-Id: Ia665bab546a9628347af45836dcbe765dc91c54f
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 1abc87b..d9f8c65 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -33,9 +33,9 @@
 NamePrefixTableEntry::generateNhlfromRteList()
 {
   m_nexthopList.reset();
-  for (auto rtpeItr = m_rteList.begin(); rtpeItr != m_rteList.end(); ++rtpeItr) {
-    for (auto nhItr = (*rtpeItr)->getNexthopList().getNextHops().begin();
-         nhItr != (*rtpeItr)->getNexthopList().getNextHops().end();
+  for (auto iterator = m_rteList.begin(); iterator != m_rteList.end(); ++iterator) {
+    for (auto nhItr = (*iterator)->getNexthopList().getNextHops().begin();
+         nhItr != (*iterator)->getNexthopList().getNextHops().end();
          ++nhItr) {
       m_nexthopList.addNextHop((*nhItr));
     }
@@ -44,32 +44,32 @@
 
 uint64_t
 NamePrefixTableEntry::removeRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
-                                              rtpePtr)
+                                              entryPtr)
 {
-  auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
+  auto iterator = std::find(m_rteList.begin(), m_rteList.end(), entryPtr);
 
-  if (rtpeItr != m_rteList.end()) {
-    (*rtpeItr)->decrementUseCount();
-    m_rteList.erase(rtpeItr);
+  if (iterator != m_rteList.end()) {
+    (*iterator)->decrementUseCount();
+    m_rteList.erase(iterator);
   }
   else {
-    _LOG_ERROR("Routing entry for: " << rtpePtr->getDestination()
+    _LOG_ERROR("Routing entry for: " << entryPtr->getDestination()
                << " not found in NPT entry: " << getNamePrefix());
   }
-  return (*rtpeItr)->getUseCount();
+  return entryPtr->getUseCount();
 }
 
 void
 NamePrefixTableEntry::addRoutingTableEntry(std::shared_ptr<RoutingTablePoolEntry>
-                                           rtpePtr)
+                                           entryPtr)
 {
-  auto rtpeItr = std::find(m_rteList.begin(), m_rteList.end(), rtpePtr);
+  auto iterator = std::find(m_rteList.begin(), m_rteList.end(), entryPtr);
 
   // Ensure that this is a new entry
-  if (rtpeItr == m_rteList.end()) {
+  if (iterator == m_rteList.end()) {
     // Adding a new routing entry to the NPT entry
-    rtpePtr->incrementUseCount();
-    m_rteList.push_back(rtpePtr);
+    entryPtr->incrementUseCount();
+    m_rteList.push_back(entryPtr);
   }
   // Note: we don't need to update in the else case because these are
   // pointers, and they are centrally-located in the NPT and will all
@@ -105,8 +105,8 @@
 {
   os << "Name: " << entry.getNamePrefix() << "\n";
 
-  for (const std::shared_ptr<RoutingTablePoolEntry> rtpePtr : entry.getRteList()) {
-    os << "Destination: " << rtpePtr->getDestination() << "\n";
+  for (const std::shared_ptr<RoutingTablePoolEntry> entryPtr : entry.getRteList()) {
+    os << "Destination: " << entryPtr->getDestination() << "\n";
   }
 
   return os;
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 6467790..251bfc5 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -45,8 +45,8 @@
 
   // Check if the advertised name prefix is in the table already.
   NptEntryList::iterator nameItr = std::find(m_table.begin(),
-                                           m_table.end(),
-                                           name);
+                                             m_table.end(),
+                                             name);
 
   // Attempt to find a routing table pool entry (RTPE) we can use.
   RtpEntryMap::iterator rtpeItr = m_rtpool.find(destRouter);
@@ -139,9 +139,8 @@
   std::shared_ptr<RoutingTablePoolEntry> rtpePtr = rtpeItr->second;
 
   // Ensure that the entry exists
-  NptEntryList::iterator nameItr = std::find_if(m_table.begin(),
-                                           m_table.end(),
-                                           std::bind(&npteCompare, _1, name));
+  NptEntryList::iterator nameItr = std::find_if(m_table.begin(), m_table.end(),
+                                                std::bind(&npteCompare, _1, name));
   if (nameItr != m_table.end()) {
     _LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
                << " from prefix: " << *nameItr);
@@ -182,7 +181,7 @@
   }
   else {
     _LOG_DEBUG("Attempted to remove origin: " << rtpePtr->getDestination()
-               << " from non-existant prefix: " << name);
+               << " from non-existent prefix: " << name);
   }
 }
 
@@ -239,7 +238,7 @@
 NamePrefixTable::deleteRtpeFromPool(std::shared_ptr<RoutingTablePoolEntry> rtpePtr)
 {
   if (m_rtpool.erase(rtpePtr->getDestination()) != 1) {
-    _LOG_DEBUG("Attempted to delete non-existant origin: "
+    _LOG_DEBUG("Attempted to delete non-existent origin: "
                << rtpePtr->getDestination()
                << " from NPT routing table entry storage pool.");
   }