diff options
author | Stefan Kost <ensonic@users.sf.net> | 2011-05-20 00:16:00 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2011-05-20 00:16:00 +0300 |
commit | ed42bca0dda48191ec20598c4b2f7b712c6b6353 (patch) | |
tree | 4a548468c9b0a8b8c26e0db76b999ca16023a6ce /gst/librfb | |
parent | f54458a7ba548ad3cb182b1e3d52213200e63f6d (diff) | |
download | gstreamer-plugins-bad-ed42bca0dda48191ec20598c4b2f7b712c6b6353.tar.gz |
librfb: don't leak password on error
Diffstat (limited to 'gst/librfb')
-rw-r--r-- | gst/librfb/vncauth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/librfb/vncauth.c b/gst/librfb/vncauth.c index d6ce7e488..dc6817366 100644 --- a/gst/librfb/vncauth.c +++ b/gst/librfb/vncauth.c @@ -96,15 +96,18 @@ vncDecryptPasswdFromFile (char *fname) { FILE *fp; int32_t i, ch; - unsigned char *passwd = (unsigned char *) malloc (9); + unsigned char *passwd; if ((fp = fopen (fname, "r")) == NULL) return NULL; + passwd = (unsigned char *) malloc (9); + for (i = 0; i < 8; i++) { ch = getc (fp); if (ch == EOF) { fclose (fp); + free (passwd); return NULL; } passwd[i] = ch; |