Skip to content
Snippets Groups Projects
Commit 43324b0e authored by George Kadianakis's avatar George Kadianakis
Browse files

Fix minor memleak in edge-case of crypto_rsa.c function.

parent 1f9055c8
No related branches found
No related tags found
No related merge requests found
......@@ -554,8 +554,10 @@ crypto_pk_read_private_key_from_filename(crypto_pk_t *env,
char *buf = read_file_to_str(keyfile, 0, &st);
if (!buf)
return -1;
if (st.st_size > MAX_PRIVKEY_FILE_LEN)
if (st.st_size > MAX_PRIVKEY_FILE_LEN) {
tor_free(buf);
return -1;
}
int rv = crypto_pk_read_private_key_from_string(env, buf,
(ssize_t)st.st_size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment