From 8b01a47358a76fd95c10e1a7e685f9f07c3f8ab0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= <bjourne@gmail.com>
Date: Wed, 24 Sep 2014 00:45:46 +0200
Subject: [PATCH] openssl.libcrypto.tests: BIO_free should be called to release
 connections

---
 .../openssl/libcrypto/libcrypto-tests.factor  | 21 +++++++++++--------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/basis/openssl/libcrypto/libcrypto-tests.factor b/basis/openssl/libcrypto/libcrypto-tests.factor
index 0a896db511..92b8dcc39f 100644
--- a/basis/openssl/libcrypto/libcrypto-tests.factor
+++ b/basis/openssl/libcrypto/libcrypto-tests.factor
@@ -10,15 +10,18 @@ IN: openssl.libcrypto.tests
 
 [ t ] [ "factorcode.org:80" BIO_new_connect bio_st? ] unit-test
 
-[ 1 ] [
-    "factorcode.org:80" BIO_new_connect BIO_C_DO_STATE_MACHINE 0 f BIO_ctrl
+[ 1 1 ] [
+    "factorcode.org:80" BIO_new_connect [
+        BIO_C_DO_STATE_MACHINE 0 f BIO_ctrl
+    ] keep BIO_free
 ] unit-test
 
-[ "HTTP/1.1 200 Document follows" ] [
-    "factorcode.org:80" BIO_new_connect
-    [ BIO_C_DO_STATE_MACHINE 0 f BIO_ctrl drop ]
-    [
-        [ "GET / HTTP/1.1\r\nHost: factorcode.org\r\n\r\n" BIO_puts drop ]
-        [ 1024 <byte-array> dup swapd 1023 BIO_read drop ] bi
-    ] bi >string "\r\n" split first
+[ "HTTP/1.1 200 Document follows" 1 ] [
+    "factorcode.org:80" BIO_new_connect [
+        [ BIO_C_DO_STATE_MACHINE 0 f BIO_ctrl drop ]
+        [
+            [ "GET / HTTP/1.1\r\nHost: factorcode.org\r\n\r\n" BIO_puts drop ]
+            [ 1024 <byte-array> dup swapd 1023 BIO_read drop ] bi
+        ] bi >string "\r\n" split first
+    ] keep BIO_free
 ] unit-test