Don't forget to free the line we read from the key file.

git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@876 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2016-01-09 17:23:36 +00:00
parent e89fab019e
commit 5b83650c3d
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ oath_key_from_file(const char *filename)
return (NULL);
/* get first non-empty non-comment line */
line = openpam_readline(f, NULL, &len);
fclose(f);
if (strlcmp("otpauth://", line, len) == 0) {
key = oath_key_from_uri(line);
} else {
@ -71,7 +72,7 @@ oath_key_from_file(const char *filename)
"unrecognized key file format: %s", filename);
key = NULL;
}
fclose(f);
free(line);
return (key);
}