sw-collector: Proper cleanup if DB query fails in check operation
authorTobias Brunner <tobias@strongswan.org>
Wed, 23 May 2018 17:08:45 +0000 (19:08 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 23 May 2018 18:25:50 +0000 (20:25 +0200)
src/sw-collector/sw-collector.c

index 2b1783e..f8229a1 100644 (file)
@@ -633,6 +633,7 @@ static int check(sw_collector_db_t *db)
        e = db->create_sw_enumerator(db, SW_QUERY_ALL, NULL);
        if (!e)
        {
+               table->destroy_function(table, (void*)free_entry);
                return EXIT_FAILURE;
        }
        while (e->enumerate(e, &sw_id, &name, &package, &version, &installed))