Fix for oops when removing ip_prefix from list
authorSven-Ola Tuecke <sven-ola@gmx.de>
Mon, 19 Jan 2009 21:52:07 +0000 (22:52 +0100)
committerSven-Ola Tuecke <sven-ola@gmx.de>
Mon, 19 Jan 2009 21:52:07 +0000 (22:52 +0100)
src/olsr_ip_prefix_list.c

index 601d426..120a5d2 100644 (file)
@@ -50,6 +50,7 @@ ip_prefix_list_flush(struct list_node *ip_prefix_head)
   struct ip_prefix_entry *entry;
 
   OLSR_FOR_ALL_IPPREFIX_ENTRIES(ip_prefix_head, entry) {
+    list_remove(&entry->node);
     free(entry);
   } OLSR_FOR_ALL_IPPREFIX_ENTRIES_END();
 }
@@ -73,6 +74,7 @@ ip_prefix_list_remove(struct list_node *ip_prefix_head, const union olsr_ip_addr
 
   OLSR_FOR_ALL_IPPREFIX_ENTRIES(ip_prefix_head, h) {
     if (ipequal(ip_version, net, &h->net.prefix) && h->net.prefix_len == prefix_len) {
+      list_remove(&h->node);
       free(h);
       return 1;
     }