From 559e6c6d2c8915f4121de09e7dfe24cd4ba4f8cf Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 21 Dec 2016 15:49:57 +0200 Subject: [Fix] Avoid reusing g_error (Fixes #1262) Reported by: @jhejl --- src/libserver/dkim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3