]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: quota_rule_parse_limits() - Return error allocated from data stack
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 14 Aug 2024 07:02:09 +0000 (10:02 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:59 +0000 (10:39 +0200)
There is no need to use the quota's memory pool for it.

src/plugins/quota/quota-util.c

index c08e2ceee100221fd859506207ce91462e54ba44..a9bae4f21dd83e4a98654cbca09d9eccef1e8a60 100644 (file)
@@ -179,33 +179,33 @@ quota_rule_parse_limits(struct event *event,
                        multiply = 1024;
                        limit = &rule->bytes_limit;
                        if (str_parse_int64(value, limit, &p) < 0) {
-                               *error_r = p_strdup_printf(root_set->set->pool,
+                               *error_r = t_strdup_printf(
                                                "Invalid storage limit: %s", value);
                                return -1;
                        }
                } else if (strcmp(key, "bytes") == 0) {
                        limit = &rule->bytes_limit;
                        if (str_parse_int64(value, limit, &p) < 0) {
-                               *error_r = p_strdup_printf(root_set->set->pool,
+                               *error_r = t_strdup_printf(
                                                "Invalid bytes limit: %s", value);
                                return -1;
                        }
                } else if (strcmp(key, "messages") == 0) {
                        limit = &rule->count_limit;
                        if (str_parse_int64(value, limit, &p) < 0) {
-                               *error_r = p_strdup_printf(root_set->set->pool,
+                               *error_r = t_strdup_printf(
                                                "Invalid bytes messages: %s", value);
                                return -1;
                        }
                } else {
-                       *error_r = p_strdup_printf(root_set->set->pool,
+                       *error_r = t_strdup_printf(
                                        "Unknown rule limit name: %s", key);
                        return -1;
                }
 
                if (quota_limit_parse(root_set, rule, p, multiply,
                                      limit, &error) < 0) {
-                       *error_r = p_strdup_printf(root_set->set->pool,
+                       *error_r = t_strdup_printf(
                                "Invalid rule limit value '%s': %s",
                                *args, error);
                        return -1;