ddd-02-conn-nonblocking-threads.c: Fix the leak of conn
authorzengwei2000 <102871671+zengwei2000@users.noreply.github.com>
Thu, 21 Dec 2023 08:41:57 +0000 (08:41 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 29 Dec 2023 10:39:16 +0000 (11:39 +0100)
Signed-off-by: zengwei zengwei1@uniontech.com
CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23115)

doc/designs/ddd/ddd-02-conn-nonblocking-threads.c

index dd981c3e6643bb915d9a243080312d55be21ded7..19d978bba078aadf7b5161f72efef6cc6be49050 100644 (file)
@@ -119,6 +119,7 @@ APP_CONN *new_conn(SSL_CTX *ctx, const char *hostname)
     if (SSL_set_alpn_protos(ssl, alpn, sizeof(alpn))) {
         /* Note: SSL_set_alpn_protos returns 1 for failure. */
         BIO_free_all(out);
+        free(conn);
         return NULL;
     }
 #endif