mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2026-06-18 14:51:03 +00:00
Remove PEM_read* anti-pattern that only happens to work because we're using a global variable
This commit is contained in:
@@ -62,7 +62,7 @@ void MoonlightInstance::LoadCert(const char* certStr, const char* keyStr)
|
|||||||
BIO_free_all(bio);
|
BIO_free_all(bio);
|
||||||
|
|
||||||
bio = BIO_new_mem_buf(_keyStr, -1);
|
bio = BIO_new_mem_buf(_keyStr, -1);
|
||||||
if(PEM_read_bio_PrivateKey(bio, &g_PrivateKey, NULL, NULL) == NULL) {
|
if (!(g_PrivateKey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL))) {
|
||||||
PostMessage(pp::Var("Error loading private key into memory"));
|
PostMessage(pp::Var("Error loading private key into memory"));
|
||||||
}
|
}
|
||||||
BIO_free_all(bio);
|
BIO_free_all(bio);
|
||||||
|
|||||||
Reference in New Issue
Block a user