]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: free ctx when libssl doesn't support NPN
authorLukas Tribus <lukas@ltri.eu>
Mon, 26 Nov 2018 21:57:17 +0000 (22:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Nov 2018 03:32:32 +0000 (04:32 +0100)
The previous fix da95fd90 ("BUILD/MINOR: ssl: fix build with non-alpn/
non-npn libssl") does fix the build in old OpenSSL release, but I
overlooked that the ctx is only freed when NPN is supported.

Fix this by moving the #endif to the proper place (this was broken in
c7566001 ("MINOR: server: Add "alpn" and "npn" keywords")).

src/ssl_sock.c

index 86d4f227a47a77616043b160cc746669d8f66136..a73fb2dd9756dbd63d83b8dbb0fae4ef7768843b 100644 (file)
@@ -4846,9 +4846,9 @@ void ssl_sock_free_srv_ctx(struct server *srv)
 #ifdef OPENSSL_NPN_NEGOTIATED
        if (srv->ssl_ctx.npn_str)
                free(srv->ssl_ctx.npn_str);
+#endif
        if (srv->ssl_ctx.ctx)
                SSL_CTX_free(srv->ssl_ctx.ctx);
-#endif
 }
 
 /* Walks down the two trees in bind_conf and frees all the certs. The pointer may