]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: work around route table asserts for deleting node with info
authorChristian Franke <nobody@nowhere.ws>
Sun, 3 Apr 2016 15:46:25 +0000 (12:46 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Apr 2016 12:06:33 +0000 (08:06 -0400)
The route table code in lib/table.c triggers an assertion when a route
node with rn->info != NULL reaches refcount 0, probably to avoid
memleaks. In this particular case, this is not an issue, since the
info will be freed by the destructor.

However, since removing this assertion probably requires more
discussion, just make sure that rn->info gets freed and unset before
its refcount is decremented to zero.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
isisd/isis_redist.c

index abb9ecd4094e34937a7cf9e3179b05a5d8ff4a28..690ae4720c866082949b161631fd93bf9cd59b12 100644 (file)
@@ -176,6 +176,7 @@ isis_redist_uninstall(struct isis_area *area, int level, struct prefix *p)
   if (!er_node->info)
     return;
 
+  XFREE(MTYPE_ISIS, er_node->info);
   route_unlock_node(er_node);
   lsp_regenerate_schedule(area, level, 0);
 }
@@ -358,6 +359,7 @@ isis_redist_delete(int type, struct prefix *p)
         isis_redist_uninstall(area, level, p);
       }
 
+  XFREE(MTYPE_ISIS, ei_node->info);
   route_unlock_node(ei_node);
 }
 
@@ -502,6 +504,7 @@ isis_redist_unset(struct isis_area *area, int level,
             continue;
         }
 
+      XFREE(MTYPE_ISIS, rn->info);
       route_unlock_node(rn);
     }