]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Mark "connection" resource as freed
authorMikhail Galanin <mgalanin@mimecast.com>
Mon, 10 Sep 2018 09:37:59 +0000 (10:37 +0100)
committerMikhail Galanin <mgalanin@mimecast.com>
Mon, 10 Sep 2018 09:37:59 +0000 (10:37 +0100)
mt.disconnect() performs free(). If we call it twice with the same argument, we will get double free()

test/functional/lua/miltertest/lib.lua

index f7dc3cc79c5057d81f8bfba83f6d479be0872c4d..e94efd559dd814b67ed610d3b6ae3495c99d063f 100644 (file)
@@ -21,7 +21,10 @@ function setup(c_ip, helo, hn)
 end
 
 function teardown()
-  mt.disconnect(conn)
+  if conn then
+    mt.disconnect(conn)
+  end
+  conn = nil
 end
 
 function send_message(body, hdrs, id, sender, rcpts)