Commit b618db52 authored by Niels Möller's avatar Niels Möller
Browse files

(read_host_key): Fixed string leak.

Rev: src/server.c:1.73
parent dfd4aba5
...@@ -195,12 +195,12 @@ read_host_key(const char *file, ...@@ -195,12 +195,12 @@ read_host_key(const char *file,
int algorithm_name; int algorithm_name;
if (fd < 0) if (fd < 0)
{ {
werror("Failed to open `%z' for reading %e\n", file, errno); werror("Failed to open `%z' for reading %e\n", file, errno);
return 0; return 0;
} }
contents = io_read_file_raw(fd, 5000); contents = io_read_file_raw(fd, 5000);
if (!contents) if (!contents)
{ {
...@@ -213,6 +213,8 @@ read_host_key(const char *file, ...@@ -213,6 +213,8 @@ read_host_key(const char *file,
s = spki_make_signer(signature_algorithms, s = spki_make_signer(signature_algorithms,
contents, contents,
&algorithm_name); &algorithm_name);
lsh_string_free(contents);
if (!s) if (!s)
{ {
werror("Invalid host key\n"); werror("Invalid host key\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment