summaryrefslogtreecommitdiffstats
path: root/agent/pksign.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-09-18 15:32:17 +0200
committerWerner Koch <wk@gnupg.org>2014-09-18 15:32:17 +0200
commitf82a6e0f08725008c5bbf702a5f4c175ea09f01c (patch)
treed71b7633ccaea21457adfdecaec0ea672abed6cc /agent/pksign.c
parentagent: Remove left over debug output. (diff)
downloadgnupg2-f82a6e0f08725008c5bbf702a5f4c175ea09f01c.tar.xz
gnupg2-f82a6e0f08725008c5bbf702a5f4c175ea09f01c.zip
agent: Init a local variable in the error case.
* agent/pksign.c (do_encode_md): Init HASH on error.
Diffstat (limited to 'agent/pksign.c')
-rw-r--r--agent/pksign.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/agent/pksign.c b/agent/pksign.c
index 9147b50d0..0160a11f1 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -62,13 +62,15 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash,
gcry_mpi_t mpi;
rc = gcry_mpi_scan (&mpi, GCRYMPI_FMT_USG, md, mdlen, NULL);
- if (! rc)
+ if (!rc)
{
rc = gcry_sexp_build (&hash, NULL,
"(data (flags raw) (value %m))",
mpi);
gcry_mpi_release (mpi);
}
+ else
+ hash = NULL;
}