]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 16 Sep 2009 22:28:20 +0000 (22:28 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 16 Sep 2009 22:28:20 +0000 (22:28 +0000)
[originally from svn r8656]

cmdline.c
unix/uxnoise.c

index aafb69000603a034bf6bc4ae5a4b03ad5d998ded..26f29c9955b6e118a9b0f7207acb8c6a63c57846 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -322,6 +322,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Config *cfg)
        cfg->remote_cmd_ptr = command;
        cfg->remote_cmd_ptr2 = NULL;
        cfg->nopty = TRUE;      /* command => no terminal */
+       fclose(fp);
     }
     if (!strcmp(p, "-P")) {
        RETURN(2);
index 7ebb9a58ab8a1e24855d2d5a0830720e9cbdc3fa..c42466f658e3a2e4b6d2c10333331ac40be3d80b 100644 (file)
@@ -35,6 +35,8 @@ static int read_dev_urandom(char *buf, int len)
        ngot += ret;
     }
 
+    close(fd);
+
     return 1;
 }