Browse Source

lib: Fix Free Pointer dereference in lib/filter.c

Coverity Scan ID 23056. access is accessed after free in access_list_delete

Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
Denil Vira 6 years ago
parent
commit
4fdb5f401e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/filter.c

+ 4 - 4
lib/filter.c

@@ -493,13 +493,13 @@ access_list_filter_delete (struct access_list *access, struct filter *filter)
 
   filter_free (filter);
 
-  /* If access_list becomes empty delete it from access_master. */
-  if (access_list_empty (access))
-    access_list_delete (access);
-
   /* Run hook function. */
   if (master->delete_hook)
     (*master->delete_hook) (access);
+
+  /* If access_list becomes empty delete it from access_master. */
+  if (access_list_empty (access))
+    access_list_delete (access);
 }
 
 /*