diff options
author | Daniel Kahn Gillmor <[email protected]> | 2014-12-19 23:53:34 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-12-22 13:00:38 +0000 |
commit | ed8383c618e124cfa708c9ee87563fcdf2f4649c (patch) | |
tree | 023bb9c385d6320338479825e1bde35eec724a01 /sm/minip12.c | |
parent | scd: Avoid double-free on error condition in scd (diff) | |
download | gnupg-ed8383c618e124cfa708c9ee87563fcdf2f4649c.tar.gz gnupg-ed8383c618e124cfa708c9ee87563fcdf2f4649c.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.
Diffstat (limited to 'sm/minip12.c')
-rw-r--r-- | sm/minip12.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sm/minip12.c b/sm/minip12.c index 01b91b710..ca4d2485d 100644 --- a/sm/minip12.c +++ b/sm/minip12.c @@ -2422,6 +2422,7 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen, " requested charset '%s': %s\n", charset, strerror (errno)); gcry_free (pwbuf); + pwbuf = NULL; goto failure; } @@ -2436,6 +2437,7 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen, " requested charset '%s': %s\n", charset, strerror (errno)); gcry_free (pwbuf); + pwbuf = NULL; jnlib_iconv_close (cd); goto failure; } |