From: jacob Date: Wed, 16 Sep 2009 22:28:20 +0000 (+0000) Subject: Fix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse. X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/2fa6ce2cd497f14cde0e43c6096813bad2a4d9c9 Fix minor file descriptor leaks. Found by cppcheck, reported by Tim Kosse. git-svn-id: svn://svn.tartarus.org/sgt/putty@8656 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/cmdline.c b/cmdline.c index aafb6900..26f29c99 100644 --- 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); diff --git a/unix/uxnoise.c b/unix/uxnoise.c index 7ebb9a58..c42466f6 100644 --- a/unix/uxnoise.c +++ b/unix/uxnoise.c @@ -35,6 +35,8 @@ static int read_dev_urandom(char *buf, int len) ngot += ret; } + close(fd); + return 1; }