diff --git a/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c b/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c index 671e0aacda7ad8787c3432a3fdd9a270faefd002..8961158139689c1ad75ac2c54f12aa8d973bc842 100644 --- a/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c +++ b/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c @@ -144,7 +144,6 @@ static void DestroyEccPubKey(HcfObjectBase *self) HcfOpensslEccPubKey *impl = (HcfOpensslEccPubKey *)self; EC_POINT_free(impl->pk); impl->pk = NULL; - HcfFree(impl); } static void DestroyEccPriKey(HcfObjectBase *self) @@ -158,7 +157,6 @@ static void DestroyEccPriKey(HcfObjectBase *self) HcfOpensslEccPriKey *impl = (HcfOpensslEccPriKey *)self; BN_clear_free(impl->sk); impl->sk = NULL; - HcfFree(impl); } static const char *GetEccPubKeyAlgorithm(HcfKey *self) diff --git a/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c b/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c index 8264afc47e97ad323781cece63af3ca1d664170c..cf8d2beb0b03f0689413c6b8f5429572917c325d 100644 --- a/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c +++ b/plugin/openssl_plugin/key/asy_key_generator/src/rsa_asy_key_generator_openssl.c @@ -133,7 +133,6 @@ static void DestroyPubKey(HcfObjectBase *self) HcfOpensslRsaPubKey *impl = (HcfOpensslRsaPubKey *)self; RSA_free(impl->pk); impl->pk = NULL; - HcfFree(self); } static void DestroyPriKey(HcfObjectBase *self) @@ -147,11 +146,8 @@ static void DestroyPriKey(HcfObjectBase *self) return; } HcfOpensslRsaPriKey *impl = (HcfOpensslRsaPriKey*)self; - if (impl->sk != NULL) { - RSA_free(impl->sk); - impl->sk = NULL; - } - HcfFree(impl); + RSA_free(impl->sk); + impl->sk = NULL; } static void DestroyKeyPair(HcfObjectBase *self)