summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble/vncauth.c
Unidiff
Diffstat (limited to 'noncore/comm/keypebble/vncauth.c') (more/less context) (show whitespace changes)
-rw-r--r--noncore/comm/keypebble/vncauth.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/comm/keypebble/vncauth.c b/noncore/comm/keypebble/vncauth.c
index 277d145..7de837a 100644
--- a/noncore/comm/keypebble/vncauth.c
+++ b/noncore/comm/keypebble/vncauth.c
@@ -95,5 +95,8 @@ vncDecryptPasswdFromFile(char *fname)
95 unsigned char *passwd = (unsigned char *)malloc(9); 95 unsigned char *passwd = (unsigned char *)malloc(9);
96 96
97 if ((fp = fopen(fname,"r")) == NULL) return NULL; 97 if ((fp = fopen(fname,"r")) == NULL) {
98 free(passwd);
99 return NULL;
100 }
98 101
99 for (i = 0; i < 8; i++) { 102 for (i = 0; i < 8; i++) {
@@ -101,4 +104,5 @@ vncDecryptPasswdFromFile(char *fname)
101 if (ch == EOF) { 104 if (ch == EOF) {
102 fclose(fp); 105 fclose(fp);
106 free(passwd);
103 return NULL; 107 return NULL;
104 } 108 }