check if acerts linked_list has been initialized before destroying it
[strongswan.git] / src / pluto / ac.c
index 310c4e7..f2d81a5 100644 (file)
@@ -46,7 +46,10 @@ void ac_initialize(void)
  */
 void ac_finalize(void)
 {
  */
 void ac_finalize(void)
 {
-       acerts->destroy_offset(acerts, offsetof(certificate_t, destroy));
+       if (acerts)
+       {
+               acerts->destroy_offset(acerts, offsetof(certificate_t, destroy));
+       }
 }
 
 /**
 }
 
 /**