sw-collector: Fix memory leak after failing to open DB
authorTobias Brunner <tobias@strongswan.org>
Tue, 8 Aug 2017 13:30:44 +0000 (15:30 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 8 Aug 2017 13:30:44 +0000 (15:30 +0200)
src/sw-collector/sw_collector_db.c

index 44505da..554c3d6 100644 (file)
@@ -366,6 +366,7 @@ sw_collector_db_t *sw_collector_db_create(char *uri)
        if (!this->db)
        {
                DBG1(DBG_IMC, "opening database URI '%s' failed", uri);
+               free(this);
                return NULL;
        }