mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
sm: Avoid double-free on iconv failure
* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid double-free of pwbuf. -- Observed by Joshua Rogers <honey@internot.info>, who proposed a slightly different fix. Debian-Bug-Id: 773472 Added fix at a second place - wk.
This commit is contained in:
parent
0fd4cd8503
commit
ced689e12a
@ -2182,6 +2182,7 @@ p12_build (gcry_mpi_t *kparms, unsigned char *cert, size_t certlen,
|
||||
" requested charset `%s': %s\n",
|
||||
charset, strerror (errno));
|
||||
gcry_free (pwbuf);
|
||||
pwbuf = NULL;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -2196,6 +2197,7 @@ p12_build (gcry_mpi_t *kparms, unsigned char *cert, size_t certlen,
|
||||
" requested charset `%s': %s\n",
|
||||
charset, strerror (errno));
|
||||
gcry_free (pwbuf);
|
||||
pwbuf = NULL;
|
||||
jnlib_iconv_close (cd);
|
||||
goto failure;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user