Skip to content

Commit db8d99d

Browse files
danbevtargos
authored andcommitted
crypto: add virtual dtor to KeyPairGenerationConfig
Currently the KeyPairGenerationConfigs class has a virtual function but no virtual destructor which means that if delete is called on a KeyPairGenerationConfig pointer to a derived instance, the derived destructor will not get called. The following warning is currently being printed when compiling: warning: delete called on 'node::crypto::KeyPairGenerationConfig' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor] delete __ptr; This commit adds a virtual destructor. PR-URL: #23215 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 894210e commit db8d99d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_crypto.cc

+1
Original file line numberDiff line numberDiff line change
@@ -4845,6 +4845,7 @@ class KeyPairGenerationConfig {
48454845
virtual bool Configure(const EVPKeyCtxPointer& ctx) {
48464846
return true;
48474847
}
4848+
virtual ~KeyPairGenerationConfig() {}
48484849
};
48494850

48504851
class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig {

0 commit comments

Comments
 (0)