[coverity] 1543087 Resource leak

This commit is contained in:
akallabeth 2024-04-11 10:51:26 +02:00 committed by akallabeth
parent 843ecfc01a
commit 88bea503fc

View File

@ -901,7 +901,10 @@ static BOOL read_pem_file(rdpSettings* settings, FreeRDP_Settings_Keys_String id
size_t length = 0;
char* pem = crypto_read_pem(file, &length);
if (!pem || (length == 0))
{
free(pem);
return FALSE;
}
BOOL rc = freerdp_settings_set_string_len(settings, id, pem, length);
free(pem);