Browse Source

Cherry-pick commit: Fix minor FILE* leak

Christoph Biedl 2 years ago
parent
commit
3f5586c0bd

+ 27 - 0
debian/patches/cherry-pick.v10-1-g198f720.fix-minor-file-leak.patch

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

+ 3 - 0
debian/patches/series

@@ -1,3 +1,6 @@
 
+# cherry-picked commits. Keep in upstream's chronological order
+cherry-pick.v10-1-g198f720.fix-minor-file-leak.patch
+
 # patches for upstream
 upstream.typo-fixes.patch