Skip to content

Commit

Permalink
Fix memory leaks for RSA key setters (esnet#949)
Browse files Browse the repository at this point in the history
Originally discussed in esnet#940.
  • Loading branch information
Oleh Yudin authored and bmah888 committed Jan 7, 2020
1 parent 4a3efb3 commit bb11530
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/iperf_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ EVP_PKEY *load_pubkey_from_base64(const char *buffer) {
BIO* bio = BIO_new(BIO_s_mem());
BIO_write(bio, key, key_len);
EVP_PKEY *pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL);
BIO_free(bio);
return (pkey);
}

Expand All @@ -196,6 +197,7 @@ EVP_PKEY *load_privkey_from_base64(const char *buffer) {
BIO* bio = BIO_new(BIO_s_mem());
BIO_write(bio, key, key_len);
EVP_PKEY *pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
BIO_free(bio);
return (pkey);
}

Expand Down

0 comments on commit bb11530

Please sign in to comment.