Commit dd251659 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Fix memory leak.

Always perform nexproto callback argument initialisation in s_server
otherwise we use uninitialised data if -nocert is specified.
parent 657e29c1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1965,6 +1965,10 @@ end:
			print_stuff(bio_c_out,con,1);
		SSL_free(con);
		}
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
	if (next_proto.data)
		OPENSSL_free(next_proto.data);
#endif
	if (ctx != NULL) SSL_CTX_free(ctx);
	if (cert)
		X509_free(cert);
+15 −16
Original line number Diff line number Diff line
@@ -1518,13 +1518,14 @@ bad:
				goto end;
				}
			}
#endif /* OPENSSL_NO_TLSEXT */
		}

# ifndef OPENSSL_NO_NEXTPROTONEG
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) 
	if (next_proto_neg_in)
		{
		unsigned short len;
			next_proto.data = next_protos_parse(&len,
				next_proto_neg_in);
		next_proto.data = next_protos_parse(&len, next_proto_neg_in);
		if (next_proto.data == NULL)
			goto end;
		next_proto.len = len;
@@ -1534,8 +1535,6 @@ bad:
		next_proto.data = NULL;
		}
#endif
#endif /* OPENSSL_NO_TLSEXT */
		}


	if (s_dcert_file)