]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
privkey_openssl: avoid deinitializing cipher context on error path
authorDaiki Ueno <ueno@gnu.org>
Wed, 17 Jul 2024 03:14:24 +0000 (12:14 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sun, 21 Jul 2024 23:49:57 +0000 (08:49 +0900)
When gnutls_cipher_init returns error, the cipher handle is not
initialized and thus shouldn't be deinitialized.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/x509/privkey_openssl.c

index 0458f3d8dec144e85b022bbff5fc5053bd4f8a1d..eb8db9353ea8bebd9c11c714ac086fc74c05577d 100644 (file)
@@ -257,7 +257,6 @@ int gnutls_x509_privkey_import_openssl(gnutls_x509_privkey_t key,
                ret = gnutls_cipher_init(&handle, cipher, &enc_key, &salt);
                if (ret < 0) {
                        gnutls_assert();
-                       gnutls_cipher_deinit(handle);
                        goto out;
                }