summaryrefslogtreecommitdiff
path: root/libpam_misc
diff options
context:
space:
mode:
Diffstat (limited to 'libpam_misc')
-rw-r--r--libpam_misc/misc_conv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c
index 3f74eeae..be53f343 100644
--- a/libpam_misc/misc_conv.c
+++ b/libpam_misc/misc_conv.c
@@ -210,8 +210,12 @@ static int read_string(int echo, const char *prompt, char **retstr)
}
line[nc] = '\0';
}
- *retstr = x_strdup(line);
+ *retstr = strdup(line);
_pam_overwrite(line);
+ if (!*retstr) {
+ D(("no memory for response string"));
+ nc = -1;
+ }
goto cleanexit; /* return malloc()ed string */