]> jfr.im git - solanum.git/commitdiff
filter: avoid a memory leak per @amdj
authorEd Kellett <redacted>
Tue, 22 Oct 2019 17:44:19 +0000 (18:44 +0100)
committerEd Kellett <redacted>
Tue, 22 Oct 2019 17:44:19 +0000 (18:44 +0100)
extensions/filter.c

index 85239bdb3847b7d917024a64151af76cfc192b8e..36c3e28831b3132fb1fcbeab86a9e2f1afec946a 100644 (file)
@@ -206,6 +206,7 @@ setfilter(const char *check, const char *data, const char **error)
                r = hs_alloc_scratch(db, &filter_scratch);
                if (r != HS_SUCCESS) {
                        if (error) *error = "couldn't allocate scratch";
+                       hs_free_database(db);
                        return -1;
                }
                if (filter_db) {