diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-12-21 15:49:57 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-12-21 15:49:57 +0200 |
commit | 559e6c6d2c8915f4121de09e7dfe24cd4ba4f8cf (patch) | |
tree | 7c33fa9cf26cade467c8725b60079ca2fc6fc006 | |
parent | f41e30b785e5d35bf11c71ed3346095eacb797b4 (diff) | |
download | rspamd-559e6c6d2c8915f4121de09e7dfe24cd4ba4f8cf.tar.gz rspamd-559e6c6d2c8915f4121de09e7dfe24cd4ba4f8cf.zip |
[Fix] Avoid reusing g_error (Fixes #1262)
Reported by: @jhejl
-rw-r--r-- | src/libserver/dkim.c | 10 |
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); } } |