summaryrefslogtreecommitdiffstats
path: root/contrib/openpam/lib/openpam_readword.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/openpam/lib/openpam_readword.c')
-rw-r--r--contrib/openpam/lib/openpam_readword.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/contrib/openpam/lib/openpam_readword.c b/contrib/openpam/lib/openpam_readword.c
index 74a4d46..1c0e9b6 100644
--- a/contrib/openpam/lib/openpam_readword.c
+++ b/contrib/openpam/lib/openpam_readword.c
@@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, size_t *lenp)
/* begin quote */
quote = ch;
/* edge case: empty quoted string */
- if (word == NULL && (word = malloc(1)) == NULL) {
- openpam_log(PAM_LOG_ERROR, "malloc(): %m");
- errno = ENOMEM;
+ if (openpam_straddch(&word, &size, &len, 0) != 0)
return (NULL);
- }
- *word = '\0';
- size = 1;
} else if (ch == quote && !escape) {
/* end quote */
quote = 0;
OpenPOWER on IntegriCloud