Fix freeing storage. Also add workaround for unittests that don't
(fully) setup storage.
Bug #991.
{
#ifdef DEBUG
BUG_ON(!storage_registraton_closed);
+#endif
+#ifdef UNITTESTS
+ if (storage_map == NULL)
+ return;
#endif
SCLogDebug("storage %p id %d", storage, id);
void StorageFreeAll(Storage *storage, StorageEnum type)
{
- if (*storage == NULL)
+ if (storage == NULL)
return;
-
#ifdef DEBUG
BUG_ON(!storage_registraton_closed);
#endif
+#ifdef UNITTESTS
+ if (storage_map == NULL)
+ return;
+#endif
Storage *store = storage;
int i;
#ifdef DEBUG
BUG_ON(!storage_registraton_closed);
#endif
+#ifdef UNITTESTS
+ if (storage_map == NULL)
+ return;
+#endif
Storage *store = *storage;
int i;