mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
sm: Simplify fix ed8383c6
* sm/minip12.c (p12_build): Release PWBUF only at the end. -- Suggested-by: Eygene Ryabinkin <rea@codelabs.ru> Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
274d7b17a9
commit
6c87d1ce66
@ -2421,8 +2421,6 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
|
||||
log_error ("can't convert passphrase to"
|
||||
" requested charset '%s': %s\n",
|
||||
charset, strerror (errno));
|
||||
gcry_free (pwbuf);
|
||||
pwbuf = NULL;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -2436,8 +2434,6 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
|
||||
log_error ("error converting passphrase to"
|
||||
" requested charset '%s': %s\n",
|
||||
charset, strerror (errno));
|
||||
gcry_free (pwbuf);
|
||||
pwbuf = NULL;
|
||||
jnlib_iconv_close (cd);
|
||||
goto failure;
|
||||
}
|
||||
@ -2511,6 +2507,8 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
|
||||
failure:
|
||||
if (pwbuf)
|
||||
{
|
||||
/* Note that wipememory is not really needed due to the use of
|
||||
gcry_malloc_secure. */
|
||||
wipememory (pwbuf, pwbufsize);
|
||||
gcry_free (pwbuf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user