]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail-crypt: Do not free global keys if no error has occured
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 16 Nov 2017 11:27:23 +0000 (13:27 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 30 Jan 2018 07:00:58 +0000 (09:00 +0200)
src/plugins/mail-crypt/mail-crypt-pluginenv.c

index 2a85c6b10d221067086c1518db268fa3eba497d9..68cf94fc6f2ef5af13d5ba411024a00155387131 100644 (file)
@@ -100,6 +100,7 @@ int mail_crypt_global_keys_load_pluginenv(const char *set_prefix,
                                                error_r) < 0)
                ret = -1;
 
-       mail_crypt_global_keys_free(global_keys_r);
+       if (ret != 0)
+               mail_crypt_global_keys_free(global_keys_r);
        return ret;
 }