aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_tcp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-14 18:08:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-14 18:08:24 +0100
commita3ce6d43de5afb2b387e2a07cedab9004c4a0cb5 (patch)
tree438e60828cf056d342585de76b625a696a97206f /src/lua/lua_tcp.c
parent1548a8c492cdd76d1cacdaddfc1ae00285e68549 (diff)
downloadrspamd-a3ce6d43de5afb2b387e2a07cedab9004c4a0cb5.tar.gz
rspamd-a3ce6d43de5afb2b387e2a07cedab9004c4a0cb5.zip
[Fix] Plug memory leak in lua_tcp
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r--src/lua/lua_tcp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index 1f7b2b05b..6e47e98a0 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -333,12 +333,7 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal,
va_start (ap, err);
for (;;) {
- if (is_fatal) {
- hdl = g_queue_pop_head (cbd->handlers);
- }
- else {
- hdl = g_queue_peek_head (cbd->handlers);
- }
+ hdl = g_queue_peek_head (cbd->handlers);
if (hdl == NULL) {
va_end (ap_copy);
@@ -380,6 +375,9 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal,
/* Stop on the first callback found */
break;
}
+ else {
+ lua_tcp_shift_handler (cbd);
+ }
}
va_end (ap);