diff --git a/include/libssh/server.h b/include/libssh/server.h index 4033dac7..12210883 100644 --- a/include/libssh/server.h +++ b/include/libssh/server.h @@ -222,6 +222,9 @@ LIBSSH_API int ssh_server_init_kex(ssh_session session); /** * @brief Free a ssh servers bind. * + * Note that this will also free options that have been set on the bind, + * including keys set with SSH_BIND_OPTIONS_IMPORT_KEY. + * * @param ssh_bind_o The ssh server bind to free. */ LIBSSH_API void ssh_bind_free(ssh_bind ssh_bind_o); diff --git a/src/options.c b/src/options.c index 676c49e7..2727b873 100644 --- a/src/options.c +++ b/src/options.c @@ -1926,7 +1926,8 @@ static int ssh_bind_set_algo(ssh_bind sshbind, * This is DEPRECATED, please do not use. * * - SSH_BIND_OPTIONS_IMPORT_KEY: - * Set the Private Key for the server directly (ssh_key) + * Set the Private Key for the server directly + * (ssh_key). It will be free'd by ssh_bind_free(). * * - SSH_BIND_OPTIONS_CIPHERS_C_S: * Set the symmetric cipher client to server (const char *,