See T1706: Resource leak in file "cipher/pubkey.c" in function "gcry_pk_encrypt" at line 2876 and "gcry_pk_genkey" at line 3623