Fix memory leak (#2348)

* Fix memory leak

* Fix flaky errors
This commit is contained in:
yhirose
2026-02-08 15:49:30 -10:00
committed by GitHub
parent 5d717e6d91
commit 4e14bc8948
4 changed files with 11 additions and 3 deletions
+4
View File
@@ -95,6 +95,8 @@ jobs:
- name: build and run tests (OpenSSL)
if: matrix.tls_backend == 'openssl'
run: cd test && make
env:
LSAN_OPTIONS: suppressions=lsan_suppressions.txt
- name: build and run tests (Mbed TLS)
if: matrix.tls_backend == 'mbedtls'
run: cd test && make test_split_mbedtls && make test_mbedtls && ./test_mbedtls
@@ -122,6 +124,8 @@ jobs:
- name: build and run tests (OpenSSL)
if: matrix.tls_backend == 'openssl'
run: cd test && make
env:
LSAN_OPTIONS: suppressions=lsan_suppressions.txt
- name: build and run tests (Mbed TLS)
if: matrix.tls_backend == 'mbedtls'
run: cd test && make test_split_mbedtls && make test_mbedtls && ./test_mbedtls
+1 -1
View File
@@ -54,7 +54,7 @@ STYLE_CHECK_FILES = $(filter-out httplib.h httplib.cc, \
$(wildcard example/*.h example/*.cc fuzzing/*.h fuzzing/*.cc *.h *.cc ../httplib.h))
all : test test_split
./test
LSAN_OPTIONS=suppressions=lsan_suppressions.txt ./test
proxy : test_proxy
@echo "Starting proxy server..."
+3
View File
@@ -0,0 +1,3 @@
# OpenSSL 3.x internal caches (provider, cipher, keymgmt) are allocated
# lazily and intentionally kept until process exit. These are not real leaks.
leak:libcrypto
+3 -2
View File
@@ -4428,7 +4428,7 @@ TEST_F(ServerTest, TooLongRequest) {
ASSERT_TRUE(res);
EXPECT_EQ(StatusCode::UriTooLong_414, res->status);
EXPECT_LE(elapsed, 100);
EXPECT_LE(elapsed, 1000);
EXPECT_EQ("close", res->get_header_value("Connection"));
EXPECT_FALSE(cli_.is_socket_open());
}
@@ -4513,7 +4513,7 @@ TEST_F(ServerTest, LongQueryValue) {
ASSERT_TRUE(res);
EXPECT_EQ(StatusCode::UriTooLong_414, res->status);
EXPECT_LE(elapsed, 100);
EXPECT_LE(elapsed, 1000);
EXPECT_EQ("close", res->get_header_value("Connection"));
EXPECT_FALSE(cli_.is_socket_open());
}
@@ -15106,6 +15106,7 @@ TEST(BindServerTest, UpdateCerts) {
ASSERT_TRUE(svr.is_valid());
svr.stop();
X509_STORE_free(cert_store);
X509_free(cert);
X509_free(ca_cert);
EVP_PKEY_free(key);