]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix resource leak in rsakey_pubblob
authorTim Kosse <tim.kosse@filezilla-project.org>
Mon, 23 Jan 2017 17:58:17 +0000 (18:58 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 28 Jan 2017 14:03:09 +0000 (14:03 +0000)
The input file was not closed after successfully loading an SSH1 key.

sshpubk.c

index 0323335ee0bfb0e98ae18de25538627bb8313e7b..a4e4a087ca6caa91467757372041090f1c385d7a 100644 (file)
--- a/sshpubk.c
+++ b/sshpubk.c
@@ -309,6 +309,7 @@ int rsakey_pubblob(const Filename *filename, void **blob, int *bloblen,
             *commentptr = commentp ? dupstr(commentp) : NULL;
         *blob = rsa_public_blob(&key, bloblen);
         freersakey(&key);
+        fclose(fp);
         return 1;
 
       not_public_either: