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/
This commit is contained in:
parent
e64a950200
commit
575318c566
|
@ -373,6 +373,7 @@ static void load_rcfile (ServerConfig *cfg)
|
||||||
|
|
||||||
if ((rcfp = fopen (rcfile, "rt"))) {
|
if ((rcfp = fopen (rcfile, "rt"))) {
|
||||||
read_rcfile (rcfp, cfg);
|
read_rcfile (rcfp, cfg);
|
||||||
|
fclose (rcfp);
|
||||||
} else {
|
} else {
|
||||||
/* rcfiles are fully optional... */
|
/* rcfiles are fully optional... */
|
||||||
debug_sys ("Could not open rcfile '%s'", rcfile);
|
debug_sys ("Could not open rcfile '%s'", rcfile);
|
||||||
|
|
|
@ -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, " To file: %s\n", job->options.save_to);
|
||||||
fprintf (error_file, " Error: %s\n", msg);
|
fprintf (error_file, " Error: %s\n", msg);
|
||||||
fprintf (error_file, " (" WMGET_VERSION_BANNER ")\n");
|
fprintf (error_file, " (" WMGET_VERSION_BANNER ")\n");
|
||||||
|
fclose (error_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue