Bug 1043891, file descriptor leak in function SECU_GetPasswordString, r=kaie
authorSachin Kumar Gupta <s.k.gupta@samsung.com>
Tue, 05 Aug 2014 00:54:16 +0200
changeset 11213 6d1763a7555e6a552261d7f056de650b99b66c57
parent 11212 11fcf4476c5f1a504db1dcb02c0715e55e1bf24b
child 11220 c7a56f8cd2e42505cdf9cf8e091cf539417f2955
push id450
push userkaie@kuix.de
push dateMon, 04 Aug 2014 22:54:23 +0000
reviewerskaie
bugs1043891
Bug 1043891, file descriptor leak in function SECU_GetPasswordString, r=kaie
cmd/lib/secutil.c
--- a/cmd/lib/secutil.c
+++ b/cmd/lib/secutil.c
@@ -87,16 +87,17 @@ SECU_GetPasswordString(void *arg, char *
     if (input == NULL) {
 	fprintf(stderr, "Error opening input terminal for read\n");
 	return NULL;
     }
 
     output = fopen(consoleName, "w");
     if (output == NULL) {
 	fprintf(stderr, "Error opening output terminal for write\n");
+	fclose(input);
 	return NULL;
     }
 
     p = SEC_GetPassword (input, output, prompt, SEC_BlindCheckPassword);
         
 
     fclose(input);
     fclose(output);