summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-04 16:58:14 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-04 16:58:14 +0000
commitb5dfdb55e69ba22bd3137375698a4a122348d672 (patch)
treed327e1b88e79ac166b81edab2806c1fa7aa9f529
parent792e4268c9e0ce930de6c468413a37a08bf6b968 (diff)
downloadrspamd-b5dfdb55e69ba22bd3137375698a4a122348d672.tar.gz
rspamd-b5dfdb55e69ba22bd3137375698a4a122348d672.zip
Do not re-set GError
-rw-r--r--src/libutil/expression.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index 90be6ae3f..a58866b79 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -51,13 +51,14 @@ enum rspamd_expression_op {
OP_CBRACE /* ) */
};
-struct rspamd_expression_elt {
- enum {
- ELT_OP = 0,
- ELT_ATOM,
- ELT_LIMIT
- } type;
+enum rspamd_expression_elt_type {
+ ELT_OP = 0,
+ ELT_ATOM,
+ ELT_LIMIT
+};
+struct rspamd_expression_elt {
+ enum rspamd_expression_elt_type type;
union {
rspamd_expression_atom_t *atom;
enum rspamd_expression_op op;
@@ -602,10 +603,15 @@ rspamd_parse_expression (const gchar *line, gsize len,
atom = subr->parse (p, end - p, pool, subr_data, err);
if (atom == NULL || atom->len == 0) {
/* We couldn't parse the atom, so go out */
- g_set_error (err, rspamd_expr_quark (),
- 500,
- "Cannot parse atom: callback function failed"
- " to parse '%.*s'", (int)(end - p), p);
+ if (err != NULL && *err == NULL) {
+ g_set_error (err,
+ rspamd_expr_quark (),
+ 500,
+ "Cannot parse atom: callback function failed"
+ " to parse '%.*s'",
+ (int) (end - p),
+ p);
+ }
goto err;
}