aboutsummaryrefslogtreecommitdiffstats
path: root/sm/encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r--sm/encrypt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 54a8bd1e9..c677a429d 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -212,8 +212,11 @@ encrypt_dek (const DEK dek, ksba_cert_t cert, unsigned char **encval)
gcry_sexp_release (s_pkey);
/* Reformat it. */
- rc = make_canon_sexp (s_ciph, encval, NULL);
- gcry_sexp_release (s_ciph);
+ if (!rc)
+ {
+ rc = make_canon_sexp (s_ciph, encval, NULL);
+ gcry_sexp_release (s_ciph);
+ }
return rc;
}