mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-24 16:43:28 +02: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"
|
log_error ("can't convert passphrase to"
|
||||||
" requested charset '%s': %s\n",
|
" requested charset '%s': %s\n",
|
||||||
charset, strerror (errno));
|
charset, strerror (errno));
|
||||||
gcry_free (pwbuf);
|
|
||||||
pwbuf = NULL;
|
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2436,8 +2434,6 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
|
|||||||
log_error ("error converting passphrase to"
|
log_error ("error converting passphrase to"
|
||||||
" requested charset '%s': %s\n",
|
" requested charset '%s': %s\n",
|
||||||
charset, strerror (errno));
|
charset, strerror (errno));
|
||||||
gcry_free (pwbuf);
|
|
||||||
pwbuf = NULL;
|
|
||||||
jnlib_iconv_close (cd);
|
jnlib_iconv_close (cd);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
@ -2511,6 +2507,8 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
|
|||||||
failure:
|
failure:
|
||||||
if (pwbuf)
|
if (pwbuf)
|
||||||
{
|
{
|
||||||
|
/* Note that wipememory is not really needed due to the use of
|
||||||
|
gcry_malloc_secure. */
|
||||||
wipememory (pwbuf, pwbufsize);
|
wipememory (pwbuf, pwbufsize);
|
||||||
gcry_free (pwbuf);
|
gcry_free (pwbuf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user