If we fail for any reason whilst parsing the keyfile from disk, don't
leak the key structure which we allocated to store the results of the
parse.
Change-Id: I21a27723f96af9428465134cfb975c83e10da535
Reviewed-on: http://gerrit.openafs.org/7102
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
{
int fd, i, code;
afs_int32 nkeys;
- struct afsconf_typedKey *key;
+ struct afsconf_typedKey *key = NULL;
fd = open(fileName, O_RDONLY);
if (fd < 0)
return 0;
fail:
+ if (key)
+ afsconf_typedKey_put(&key);
+
close(fd);
return EIO;
}