You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
763 B

  1. From 198f7207427ad7f569aa3592ea16e2bb400db040 Mon Sep 17 00:00:00 2001
  2. From: Nathaniel McCallum <npmccallum@redhat.com>
  3. Date: Fri, 29 Sep 2017 14:49:57 -0400
  4. Subject: [PATCH] Fix minor FILE* leak
  5. ---
  6. cmd/jwe/pwd.h | 5 ++++-
  7. 1 file changed, 4 insertions(+), 1 deletion(-)
  8. --- a/cmd/jwe/pwd.h
  9. +++ b/cmd/jwe/pwd.h
  10. @@ -57,8 +57,10 @@ jwe_getpass(const char *prompt)
  11. nf.c_lflag &= ~ECHO;
  12. nf.c_lflag |= ECHONL;
  13. - if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0)
  14. + if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0) {
  15. + fclose(tty);
  16. return NULL;
  17. + }
  18. fprintf(tty, "%s", prompt);
  19. @@ -72,6 +74,7 @@ jwe_getpass(const char *prompt)
  20. }
  21. tcsetattr(fileno(tty), TCSANOW, &of);
  22. + fclose(tty);
  23. return pwd;
  24. }
  25. #endif