mirror of
https://github.com/wiiu-env/AromaUpdater.git
synced 2025-01-27 20:15:34 +01:00
Init and free the cacert properly
This commit is contained in:
parent
43dc79a5bf
commit
281956d8d0
@ -64,6 +64,8 @@ bool DownloadUtils::Init() {
|
||||
return false;
|
||||
}
|
||||
|
||||
cacert_pem = nullptr;
|
||||
cacert_pem_size = 0;
|
||||
if (LoadFileToMem(CERT_FILE_LOCATION, &cacert_pem, &cacert_pem_size) < 0) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to load cert");
|
||||
cacert_pem = nullptr;
|
||||
@ -79,9 +81,11 @@ void DownloadUtils::Deinit() {
|
||||
return;
|
||||
}
|
||||
|
||||
free(cacert_pem);
|
||||
cacert_pem = nullptr;
|
||||
cacert_pem_size = 0;
|
||||
if (cacert_pem != nullptr) {
|
||||
free(cacert_pem);
|
||||
cacert_pem = nullptr;
|
||||
cacert_pem_size = 0;
|
||||
}
|
||||
curl_global_cleanup();
|
||||
libInitDone = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user