From: Nick Mathewson Date: Tue, 3 May 2016 16:52:29 +0000 (-0400) Subject: Do not leak the 'tag' when trying to read a truncated ed25519 key file X-Git-Tag: tor-0.2.9.1-alpha~240^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec81329339429182169c27f05c35e86ae9325267;p=thirdparty%2Ftor.git Do not leak the 'tag' when trying to read a truncated ed25519 key file Fix for bug 18956. --- diff --git a/changes/bug18956 b/changes/bug18956 new file mode 100644 index 0000000000..0cf10e9224 --- /dev/null +++ b/changes/bug18956 @@ -0,0 +1,5 @@ + o Minor bugfixes (memory leaks): + - Fix a small, uncommon memory leak that could occur when reading a + truncated ed25519 key file. Fixes bug 18956; bugfix on 0.2.6.1-alpha. + + diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c index 654611553e..c687a1b246 100644 --- a/src/common/crypto_ed25519.c +++ b/src/common/crypto_ed25519.c @@ -433,6 +433,7 @@ ed25519_seckey_read_from_file(ed25519_secret_key_t *seckey_out, errno = EINVAL; } + tor_free(*tag_out); return -1; } @@ -472,6 +473,7 @@ ed25519_pubkey_read_from_file(ed25519_public_key_t *pubkey_out, errno = EINVAL; } + tor_free(*tag_out); return -1; }