git://git.openafs.org
/
openafs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
auth: Don't leak key on file parse error
[openafs.git]
/
src
/
auth
/
keys.c
diff --git
a/src/auth/keys.c
b/src/auth/keys.c
index
52d1265
..
ba6843d
100644
(file)
--- a/
src/auth/keys.c
+++ b/
src/auth/keys.c
@@
-458,7
+458,7
@@
_parseExtendedKeyFile(struct afsconf_dir *dir, char *fileName)
{
int fd, i, code;
afs_int32 nkeys;
- struct afsconf_typedKey *key;
+ struct afsconf_typedKey *key = NULL;
fd = open(fileName, O_RDONLY);
if (fd < 0)
@@
-530,6
+530,9
@@
_parseExtendedKeyFile(struct afsconf_dir *dir, char *fileName)
return 0;
fail:
+ if (key)
+ afsconf_typedKey_put(&key);
+
close(fd);
return EIO;
}