aboutsummaryrefslogtreecommitdiffstats
path: root/agent/protect.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/protect.c')
-rw-r--r--agent/protect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/agent/protect.c b/agent/protect.c
index 8b022ecfb..d6457ad2a 100644
--- a/agent/protect.c
+++ b/agent/protect.c
@@ -176,8 +176,11 @@ do_encryption (const unsigned char *protbegin, size_t protlen,
iv = xtrymalloc (blklen*2+8);
if (!iv)
rc = gpg_error (GPG_ERR_ENOMEM);
- gcry_create_nonce (iv, blklen*2+8);
- rc = gcry_cipher_setiv (hd, iv, blklen);
+ else
+ {
+ gcry_create_nonce (iv, blklen*2+8);
+ rc = gcry_cipher_setiv (hd, iv, blklen);
+ }
}
if (!rc)
{