Closed mikehall-ms closed 2 years ago
Since the free is done at cleanup, than the deviceCert
needs to be defined at the top of the function instead of where it is used.
Something like below.
static int GetDeviceID(char* deviceId, size_t deviceIdLength)
{
int result = -1;
bool wolfSslInitialized = false;
WOLFSSL_X509* deviceCert = NULL;
........
free the deviceCert once a device Id has been retrieved.