conf: olsrd_free_cnf: reorder a bit
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 16 Nov 2015 12:39:56 +0000 (13:39 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 16 Nov 2015 14:26:30 +0000 (15:26 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/cfgparser/olsrd_conf.c

index d66a2ae..c9bf9f7 100644 (file)
@@ -987,7 +987,8 @@ olsrd_sanity_check_cnf(struct olsrd_config *cnf)
 void
 olsrd_free_cnf(struct olsrd_config *cnf)
 {
-  ip_prefix_list_clear(&cnf->hna_entries);
+  free(cnf->lock_file);
+  cnf->lock_file = NULL;
 
   while (cnf->interfaces) {
     struct olsr_if *interface;
@@ -1008,6 +1009,8 @@ olsrd_free_cnf(struct olsrd_config *cnf)
     free(interface);
   }
 
+  ip_prefix_list_clear(&cnf->hna_entries);
+
   while (cnf->plugins) {
     struct plugin_entry *plugin = cnf->plugins;
     cnf->plugins = cnf->plugins->next;
@@ -1018,9 +1021,6 @@ olsrd_free_cnf(struct olsrd_config *cnf)
   free(cnf->configuration_file);
   cnf->configuration_file = NULL;
 
-  free(cnf->lock_file);
-  cnf->lock_file = NULL;
-
   return;
 }