From: Simon Wilkinson Date: Tue, 12 Feb 2013 12:59:08 +0000 (+0000) Subject: auth: Avoid double free in key parsing X-Git-Tag: upstream/1.8.0_pre1^2~1509 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e816db093b7d4e85eaa23661bb9dba851b1e534e;p=packages%2Fo%2Fopenafs.git auth: Avoid double free in key parsing There was an error path whilst reading an extended key file which could result in a key being freed using free(key), and then freed again through the afsconf_typedKey_put() mechanism. Remove this double free. Caught by clang-analyzer Change-Id: I40bff56eddf4cb499ae5b7effdaf82f22379109d Reviewed-on: http://gerrit.openafs.org/9147 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/auth/keys.c b/src/auth/keys.c index 9bfa67ac3..d3731c62b 100644 --- a/src/auth/keys.c +++ b/src/auth/keys.c @@ -522,7 +522,6 @@ _parseExtendedKeyFile(struct afsconf_dir *dir, char *fileName) code = read(fd, key->key.val, reclen); if (code != reclen) { rx_opaque_freeContents(&key->key); - free(key); goto fail; } code = addMemoryKey(dir, key, 1);