diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:35:41 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:44:51 +0100 |
commit | 2dc402a80ceb3bcd7005fd1405c8bffbfdd3e598 (patch) | |
tree | 1003a201b9a7391fc80ed89d27ab01a97bddc4ff /src/libserver/milter.c | |
parent | afbf253dfec60164ab94f6003f6aa73e710cfbdd (diff) | |
download | rspamd-2dc402a80ceb3bcd7005fd1405c8bffbfdd3e598.tar.gz rspamd-2dc402a80ceb3bcd7005fd1405c8bffbfdd3e598.zip |
[Minor] Fix leaks
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r-- | src/libserver/milter.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c index ca8589185..de20d1d4d 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -1048,6 +1048,7 @@ rspamd_milter_set_reply (struct rspamd_milter_session *session, rspamd_printf_gstring (buf, "%V %V %V", xcode, rcode, reply); ret = rspamd_milter_send_action (session, RSPAMD_MILTER_REPLYCODE, buf); + g_string_free (buf, TRUE); return ret; } @@ -1418,7 +1419,7 @@ rspamd_milter_send_task_results (struct rspamd_milter_session *session, const ucl_object_t *elt; struct rspamd_milter_private *priv = session->priv; gint action = METRIC_ACTION_REJECT; - rspamd_fstring_t *xcode, *rcode, *reply = NULL; + rspamd_fstring_t *xcode = NULL, *rcode = NULL, *reply = NULL; GString *hname, *hvalue; if (results == NULL) { @@ -1487,7 +1488,6 @@ rspamd_milter_send_task_results (struct rspamd_milter_session *session, rspamd_milter_set_reply (session, rcode, xcode, reply); rspamd_milter_send_action (session, RSPAMD_MILTER_REJECT); - break; case METRIC_ACTION_SOFT_REJECT: case METRIC_ACTION_GREYLIST: @@ -1539,6 +1539,10 @@ rspamd_milter_send_task_results (struct rspamd_milter_session *session, rspamd_milter_send_action (session, RSPAMD_MILTER_ACCEPT); break; } + + rspamd_fstring_free (rcode); + rspamd_fstring_free (xcode); + rspamd_fstring_free (reply); } void |