diff options
Diffstat (limited to 'shadow.c')
| -rw-r--r-- | shadow.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -11,6 +11,7 @@ #endif #include "comm.h" #include "log.h" +#include "password-buffer.h" #include "swaylock.h" void initialize_pw_backend(int argc, char **argv) { @@ -81,23 +82,19 @@ void run_pw_backend_child(void) { } char *c = crypt(buf, encpw); + password_buffer_destroy(buf, size); + buf = NULL; + if (c == NULL) { swaylock_log_errno(LOG_ERROR, "crypt failed"); - clear_buffer(buf, size); exit(EXIT_FAILURE); } bool success = strcmp(c, encpw) == 0; if (!write_comm_reply(success)) { - clear_buffer(buf, size); exit(EXIT_FAILURE); } - // We don't want to keep it in memory longer than necessary, - // so clear *before* sleeping. - clear_buffer(buf, size); - free(buf); - sleep(2); } |
