summaryrefslogtreecommitdiffstats
path: root/runtime/libgcry.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/libgcry.c')
-rw-r--r--runtime/libgcry.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/libgcry.c b/runtime/libgcry.c
index 5f1dbf58..c1ab3abf 100644
--- a/runtime/libgcry.c
+++ b/runtime/libgcry.c
@@ -108,8 +108,10 @@ rsgcrySetKey(gcryctx ctx, unsigned char *key, uint16_t keyLen)
uint16_t reqKeyLen = gcry_cipher_get_algo_keylen(GCRY_CIPHER);
int r;
- if(keyLen != reqKeyLen)
+ if(keyLen != reqKeyLen) {
r = reqKeyLen;
+ goto done;
+ }
ctx->keyLen = keyLen;
ctx->key = malloc(keyLen);
memcpy(ctx->key, key, keyLen);