Plug potential memory leak reported by Coverity Scan. I'm not sure it

can actually ever occur, but the extra free() is harmless, provided we
make sure not to free() something we're still using.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@877 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2016-01-09 17:26:18 +00:00
parent 5b83650c3d
commit 4e92aa7e24
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);
}