cherry-pick.v10-1-g198f720.fix-minor-file-leak.patch 632 B

123456789101112131415161718192021222324252627
  1. Subject: Fix minor FILE* leak
  2. Origin: v10-1-g198f720 <https://github.com/latchset/jose/commit/v10-1-g198f720>
  3. Upstream-Author: Nathaniel McCallum <npmccallum@redhat.com>
  4. Date: Fri Sep 29 14:49:57 2017 -0400
  5. --- a/cmd/jwe/pwd.h
  6. +++ b/cmd/jwe/pwd.h
  7. @@ -57,8 +57,10 @@
  8. nf.c_lflag &= ~ECHO;
  9. nf.c_lflag |= ECHONL;
  10. - if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0)
  11. + if (tcsetattr(fileno(tty), TCSANOW, &nf) != 0) {
  12. + fclose(tty);
  13. return NULL;
  14. + }
  15. fprintf(tty, "%s", prompt);
  16. @@ -72,6 +74,7 @@
  17. }
  18. tcsetattr(fileno(tty), TCSANOW, &of);
  19. + fclose(tty);
  20. return pwd;
  21. }
  22. #endif