g10: Fix memory leak.
authorJustus Winter <justus@g10code.com>
Fri, 9 Dec 2016 12:12:30 +0000 (13:12 +0100)
committerJustus Winter <justus@g10code.com>
Fri, 9 Dec 2016 12:13:45 +0000 (13:13 +0100)
* g10/sign.c (do_sign): Release old signature data.

Signed-off-by: Justus Winter <justus@g10code.com>
g10/sign.c

index 19ca484..acc894c 100644 (file)
@@ -282,7 +282,9 @@ do_sign (PKT_public_key *pksk, PKT_signature *sig,
   sig->digest_algo = mdalgo;
   sig->digest_start[0] = dp[0];
   sig->digest_start[1] = dp[1];
+  mpi_release (sig->data[0]);
   sig->data[0] = NULL;
+  mpi_release (sig->data[1]);
   sig->data[1] = NULL;