swima-collector: Fix compile error if SWID_DIRECTORY is not defined
authorTobias Brunner <tobias@strongswan.org>
Mon, 24 Jul 2017 09:34:39 +0000 (11:34 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 24 Jul 2017 09:34:39 +0000 (11:34 +0200)
src/libimcv/swima/swima_collector.c

index ab5a7b6..0fd3d14 100644 (file)
 #define SOURCE_ID_GENERATOR            1
 #define SOURCE_ID_COLLECTOR            2
 
+#ifndef SWID_DIRECTORY
+#define SWID_DIRECTORY NULL
+#endif
+
 #define SWID_GENERATOR "/usr/local/bin/swid_generator"
 
 /**
@@ -386,6 +390,11 @@ static bool collect_tags(private_swima_collector_t *this, char *pathname,
        enumerator_t *enumerator;
        int i;
 
+       if (!pathname)
+       {
+               return TRUE;
+       }
+
        enumerator = enumerator_create_directory(pathname);
        if (!enumerator)
        {
@@ -618,7 +627,7 @@ swima_collector_t *swima_collector_create(void)
                        {
                                DBG1(DBG_IMC, "database query for last event failed");
                                DESTROY_IF(e);
-                               db->destroy(db);                                
+                               db->destroy(db);
                        }
                        else
                        {