summaryrefslogtreecommitdiff
path: root/src/modules.c
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-07 17:01:58 -0500
committerAdam <Adam@anope.org>2010-12-07 17:01:58 -0500
commit2b7dd6c2a023186aefe12eaee7d33595379bf4c5 (patch)
tree712274ce279d5a8fc08cd6538fbe2fbbf2f3ad52 /src/modules.c
parentc5fc11f5fe92b31200dc6cf542514b1ffeb70c44 (diff)
Fixed some warnings found by cppcheck
Diffstat (limited to 'src/modules.c')
-rw-r--r--src/modules.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules.c b/src/modules.c
index 7e7061647..ab3352ac8 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -537,7 +537,7 @@ int moduleCopyFile(char *name, char *output)
int ch;
FILE *source, *target;
int srcfp;
- char input[4096];
+ char input[4096] = "";
int len;
strncpy(input, MODULE_PATH, 4095); /* Get full path with module extension */
@@ -562,6 +562,7 @@ int moduleCopyFile(char *name, char *output)
*/
#ifndef _WIN32
if ((source = fopen(input, "r")) == NULL) {
+ close(srcfp);
#else
if ((source = fopen(input, "rb")) == NULL) {
#endif
@@ -572,6 +573,7 @@ int moduleCopyFile(char *name, char *output)
#else
if ((target = fopen(output, "wb")) == NULL) {
#endif
+ fclose(source);
return MOD_ERR_FILE_IO;
}
while ((ch = fgetc(source)) != EOF) {