]> jfr.im git - solanum.git/blobdiff - extensions/filter.c
Merge pull request #302 from edk0/sasl-usercloak
[solanum.git] / extensions / filter.c
index c4a7f0d67048e010d4383cc5793c001b6f5c370f..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) {
@@ -230,7 +231,7 @@ setfilter(const char *check, const char *data, const char **error)
 
        if (state == FILTER_FILLING) {
                int dl;
-               unsigned char *d = rb_base64_decode(data, strlen(data), &dl);
+               unsigned char *d = rb_base64_decode((unsigned char *)data, strlen(data), &dl);
                if (!d) {
                        if (error) *error = "invalid data";
                        return -1;