[Pkg-wmaker-commits] [wmget] 03/06: wmget: Fix resource leaks.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Feb 7 17:11:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch newupstream
in repository wmget.

commit 7f30f59d5e9983d875e1de5c878ea8ae0c36ac34
Author: Doug Torrance <dtorrance at piedmont.edu>
Date:   Sun Feb 7 00:53:17 2016 -0500

    wmget: Fix resource leaks.
    
    In particular, fclose() all the files we fopen().  From Debian [1].
    
    [1] http://sources.debian.net/src/wmget/0.6.0-5/debian/patches/
        fix_resource_leaks.patch/
---
 configure.c | 1 +
 retrieve.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configure.c b/configure.c
index 71678ed..d271e00 100644
--- a/configure.c
+++ b/configure.c
@@ -373,6 +373,7 @@ static void load_rcfile (ServerConfig *cfg)
 
     if ((rcfp = fopen (rcfile, "rt"))) {
         read_rcfile (rcfp, cfg);
+        fclose (rcfp);
     } else {
         /* rcfiles are fully optional... */
         debug_sys ("Could not open rcfile '%s'", rcfile);
diff --git a/retrieve.c b/retrieve.c
index 4ba2908..d58b7cb 100644
--- a/retrieve.c
+++ b/retrieve.c
@@ -98,6 +98,7 @@ void write_error_file (Job *job, const char *msg)
     fprintf (error_file, " To file: %s\n", job->options.save_to);
     fprintf (error_file, " Error: %s\n", msg);
     fprintf (error_file, " (" WMGET_VERSION_BANNER ")\n");
+    fclose (error_file);
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmget.git



More information about the Pkg-wmaker-commits mailing list