mirror of https://github.com/wolfSSL/wolfTPM.git
F-3506 - https://fenrir.wolfssl.com/finding/3506 - examples/keygen/keyload: guard primary unload against NULL on early init failure
parent
d2dc2f726d
commit
5e50cff6f5
|
|
@ -224,7 +224,8 @@ exit:
|
|||
}
|
||||
|
||||
/* Close key handles */
|
||||
wolfTPM2_UnloadHandle(&dev, &primary->handle);
|
||||
if (primary != NULL)
|
||||
wolfTPM2_UnloadHandle(&dev, &primary->handle);
|
||||
/* newKey.handle is already flushed by wolfTPM2_NVStoreKey */
|
||||
if (!persistent) {
|
||||
wolfTPM2_UnloadHandle(&dev, &newKey.handle);
|
||||
|
|
|
|||
Loading…
Reference in New Issue