aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/dkim.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index 873d59d22..00b633b18 100644
--- a/src/libserver/dkim.c
+++ b/src/libserver/dkim.c
@@ -1130,6 +1130,11 @@ rspamd_dkim_dns_cb (struct rdns_reply *reply, gpointer arg)
LL_FOREACH (reply->entries, elt)
{
if (elt->type == RDNS_REQUEST_TXT) {
+ if (err != NULL) {
+ /* Free error as it is insignificant */
+ g_error_free (err);
+ err = NULL;
+ }
key = rspamd_dkim_parse_key (cbdata->ctx, elt->content.txt.data,
&keylen,
&err);
@@ -1139,11 +1144,6 @@ rspamd_dkim_dns_cb (struct rdns_reply *reply, gpointer arg)
}
}
}
- if (key != NULL && err != NULL) {
- /* Free error as it is insignificant */
- g_error_free (err);
- err = NULL;
- }
cbdata->handler (key, keylen, cbdata->ctx, cbdata->ud, err);
}
}