intel / dps-for-iot

Other
61 stars 23 forks source link

dps-micro tries to free a static variable when destroying a node #129

Open marklocascio opened 3 years ago

marklocascio commented 3 years ago

The dps-micro DPS_CreateKeyStore() method is called by DPS_CreateNode(). DPS_CreateKeyStore() creates a static variable for the keystore and returns a pointer to it. Then, when we destroy the node, we call DPS_DestroyKeyStore() and try to free various parts of the static keystore. This can (will?) segfault on some (all?) systems.

We could allocate the keystore on the heap instead, or if it needs to be static, we can reinitialize the keystore to zero when destroying it.