agent: Init a local variable in the error case.

* agent/pksign.c (do_encode_md): Init HASH on error.
This commit is contained in:
Werner Koch 2014-09-18 15:32:17 +02:00
parent 4f35ef499a
commit f82a6e0f08
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}