diff options
author | Daniel Kahn Gillmor <[email protected]> | 2014-12-19 23:53:34 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2015-01-13 01:52:22 +0000 |
commit | ced689e12a5037c6aeca62e9eaebdc098bd9c14e (patch) | |
tree | 0c8f7ff58c585c012f7aaddea3c49160a3115699 | |
parent | scd: Avoid double-free on error condition in scd (diff) | |
download | gnupg-ced689e12a5037c6aeca62e9eaebdc098bd9c14e.tar.gz gnupg-ced689e12a5037c6aeca62e9eaebdc098bd9c14e.zip |
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 <[email protected]>, who proposed a
slightly different fix.
Debian-Bug-Id: 773472
Added fix at a second place - wk.
-rw-r--r-- | agent/minip12.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/minip12.c b/agent/minip12.c index 247171773..0bcab5f95 100644 --- a/agent/minip12.c +++ b/agent/minip12.c @@ -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; } |