merge r877: plug hypothetical memory leak

git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/branches/nooath@897 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2017-01-17 14:35:09 +00:00
parent 204469e6c6
commit 9ce6a3fc2c
1 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,7 @@ openpam_readlinev(FILE *f, int *lineno, int *lenp)
/* insert our word */
wordv[wordvlen++] = word;
wordv[wordvlen] = NULL;
word = NULL;
}
if (errno != 0) {
/* I/O error or out of memory */
@ -86,6 +87,7 @@ openpam_readlinev(FILE *f, int *lineno, int *lenp)
while (wordvlen--)
free(wordv[wordvlen]);
free(wordv);
free(word);
errno = serrno;
return (NULL);
}