]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Fix leaking BN points
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 25 Jan 2023 19:51:25 +0000 (21:51 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Fri, 27 Jan 2023 07:38:45 +0000 (07:38 +0000)
Broken in d352e5545a9422f3b0d74fd40d94c9f9a0770fb7

src/lib-dcrypt/dcrypt-openssl3.c

index 1b3534a3316d2998f623687815ddc626cdec30f0..461de7b8851fe3d46a523c0b1de9e223ea8fb142 100644 (file)
@@ -1432,6 +1432,7 @@ dcrypt_openssl_load_private_key_dovecot_v2(struct dcrypt_private_key **key_r,
                        BN_free(point);
                        return FALSE;
                }
+               BN_free(point);
                *key_r = i_new(struct dcrypt_private_key, 1);
                (*key_r)->key = pkey;
                (*key_r)->ref++;
@@ -3349,6 +3350,7 @@ dcrypt_openssl_key_load_private_raw(struct dcrypt_private_key **key_r,
                        return FALSE;
                }
 
+               BN_free(point);
                *key_r = i_new(struct dcrypt_private_key, 1);
                (*key_r)->key = pkey;
                (*key_r)->ref++;