2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

stream-ssl: Fix memory leak in error scenario

ssl_new_stream() takes ownership of the passed-in 'name' parameter.
In error scenarios, the name is leaked. I was able to trigger this
leak by attempting to connect to an ovsdb over SSL and specifying
non-existent certificate, private key, and CA cert files.

This patch fixes the problem by freeing 'name' in the error label.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
This commit is contained in:
Mark Michelson
2017-07-21 15:46:00 -05:00
committed by Russell Bryant
parent 76a0fdf749
commit fc17717869

View File

@@ -300,6 +300,7 @@ error:
SSL_free(ssl);
}
closesocket(fd);
free(name);
return retval;
}